mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
strconv: fix atof test
This commit is contained in:
parent
774fb7e850
commit
98086d7259
@ -40,7 +40,7 @@ fn test_atof() {
|
|||||||
// slow atof
|
// slow atof
|
||||||
assert strconv.atof64(src_num_str[c]).strlong() == x.strlong()
|
assert strconv.atof64(src_num_str[c]).strlong() == x.strlong()
|
||||||
|
|
||||||
|
|
||||||
// quick atof
|
// quick atof
|
||||||
mut s1 := (atofq.atof_quick(src_num_str[c]).str())
|
mut s1 := (atofq.atof_quick(src_num_str[c]).str())
|
||||||
mut s2 := (x.str())
|
mut s2 := (x.str())
|
||||||
@ -52,7 +52,7 @@ fn test_atof() {
|
|||||||
n1 := x.strsci(18)
|
n1 := x.strsci(18)
|
||||||
n2 := f64(C.atof(src_num_str[c].str)).strsci(18)
|
n2 := f64(C.atof(src_num_str[c].str)).strsci(18)
|
||||||
//println("$n1 $n2")
|
//println("$n1 $n2")
|
||||||
assert n1 == n2
|
assert n1 == n2
|
||||||
}
|
}
|
||||||
|
|
||||||
// check conversion case 2 string <==> f64
|
// check conversion case 2 string <==> f64
|
||||||
@ -65,8 +65,8 @@ fn test_atof() {
|
|||||||
|
|
||||||
// special cases
|
// special cases
|
||||||
mut f1 := f64(0.0)
|
mut f1 := f64(0.0)
|
||||||
mut ptr := *u64(&f1)
|
mut ptr := &u64(&f1)
|
||||||
ptr = *u64(&f1)
|
ptr = &u64(&f1)
|
||||||
|
|
||||||
// DOUBLE_PLUS_ZERO
|
// DOUBLE_PLUS_ZERO
|
||||||
f1=0.0
|
f1=0.0
|
||||||
|
Loading…
Reference in New Issue
Block a user