mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Move negation in internal_rat_to_float to end of procedure
This should cause a compiler error, due to the assignment to a named return value in a deferred block. Fixes #4565
This commit is contained in:
@@ -378,9 +378,6 @@ internal_rat_to_float :: proc($T: typeid, z: ^Rat, allocator := context.allocato
|
|||||||
}
|
}
|
||||||
|
|
||||||
has_sign := a.sign != b.sign
|
has_sign := a.sign != b.sign
|
||||||
defer if has_sign {
|
|
||||||
f = -builtin.abs(f)
|
|
||||||
}
|
|
||||||
|
|
||||||
exp := alen - blen
|
exp := alen - blen
|
||||||
a2, b2 := &Int{}, &Int{}
|
a2, b2 := &Int{}, &Int{}
|
||||||
@@ -440,6 +437,9 @@ internal_rat_to_float :: proc($T: typeid, z: ^Rat, allocator := context.allocato
|
|||||||
if math.is_inf(f, 0) {
|
if math.is_inf(f, 0) {
|
||||||
exact = false
|
exact = false
|
||||||
}
|
}
|
||||||
|
if has_sign {
|
||||||
|
f = -builtin.abs(f)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user