rename SomeReal to SomeFloat (#7617)
* rename SomeReal to SomeFloat * added changelog entry
This commit is contained in:
parent
b98cd3bf34
commit
efae366857
6 changed files with 38 additions and 34 deletions
|
|
@ -353,7 +353,7 @@ proc writeformat(o: var Writer; p: pointer; fmt: Format) =
|
|||
f.baseprefix = true
|
||||
writeformat(o, add, cast[uint](p), f)
|
||||
|
||||
proc writeformat(o: var Writer; x: SomeReal; fmt: Format) =
|
||||
proc writeformat(o: var Writer; x: SomeFloat; fmt: Format) =
|
||||
## Write real number `x` according to format `fmt` using output
|
||||
## object `o` and output function `add`.
|
||||
var fmt = fmt
|
||||
|
|
@ -401,8 +401,8 @@ proc writeformat(o: var Writer; x: SomeReal; fmt: Format) =
|
|||
else:
|
||||
len += 4 # exponent
|
||||
# shift y so that 1 <= abs(y) < 2
|
||||
if exp > 0: y /= pow(10.SomeReal, abs(exp).SomeReal)
|
||||
elif exp < 0: y *= pow(10.SomeReal, abs(exp).SomeReal)
|
||||
if exp > 0: y /= pow(10.SomeFloat, abs(exp).SomeFloat)
|
||||
elif exp < 0: y *= pow(10.SomeFloat, abs(exp).SomeFloat)
|
||||
elif fmt.typ == ftPercent:
|
||||
len += 1 # percent sign
|
||||
|
||||
|
|
@ -413,7 +413,7 @@ proc writeformat(o: var Writer; x: SomeReal; fmt: Format) =
|
|||
var mult = 1'i64
|
||||
for i in 1..prec: mult *= 10
|
||||
var num = y.int64
|
||||
var fr = ((y - num.SomeReal) * mult.SomeReal).int64
|
||||
var fr = ((y - num.SomeFloat) * mult.SomeFloat).int64
|
||||
# build integer part string
|
||||
while num != 0:
|
||||
numstr[numlen] = ('0'.int + (num mod 10)).char
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue