File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
1
function string (x:: DoubleFloat{T} ) where {T<: IEEEFloat }
2
- ! isfinite (HI (x)) && return string (HI (x))
2
+ (! isfinite (HI (x)) || LO (x) === 0.0 ) && return string (HI (x))
3
+ str = string (Float128 (x))
4
+ eat = findlast (' e' , str)
5
+ isnothing (eat) && return str
6
+ str[eat+ 2 : end ] === " 00" && return (str[1 : eat- 1 ])
7
+
8
+ zat = eat - 1
9
+ while str[zat] === ' 0'
10
+ zat -= 1
11
+ end
12
+ if (str[zat] === ' .' ) zat += 1 end
13
+ str[1 : zat] * str[eat: end ]
14
+ end
15
+
16
+ function string (x:: DoubleFloat{T} ) where {T<: IEEEFloat }
17
+ (! isfinite (HI (x)) || LO (x) === 0.0 ) && return string (HI (x))
3
18
str = string (Float128 (x))
4
19
if endswith (" e+00" , str)
5
20
str = str[1 : end - 4 ]
6
21
end
7
22
str
8
- end
23
+ end
9
24
10
25
function string (x:: Complex{DoubleFloat{T}} ) where {T<: IEEEFloat }
11
26
xreal, ximag = reim (x)
You can’t perform that action at this time.
0 commit comments