New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
floor/ceiling/round math builtins should return Int #508
Comments
From @cspencerThe floor/ceiling/round math builtins were returning Num values, causing my Int $x = round(5.4); to fail with a type mismatch. This patch fixes the above builtins so that The patch is against src/builtins/math.pir |
From @cspencermath.patch28,30c28,31
< .param num a
< floor a
< .return (a)
---
> .param num n
> .local int i
> floor i, n
> .return (i)
44,46c45,48
< .param num a
< ceil a
< .return (a)
---
> .param num n
> .local int i
> ceil i, n
> .return (i)
61,64c63,67
< .param num a
< a += 0.5
< $N0 = floor a
< .return ($N0)
---
> .param num n
> .local int i
> n += 0.5
> floor i, n
> .return (i)
|
From @moritzOn Fri Dec 19 08:35:04 2008, cspencer wrote:
Thanks, applied as r34116, and added tests to t/spec/S29-num/rounders.t In future it would be nice if you could generate your patches with 'svn Cheers, |
The RT System itself - Status changed from 'new' to 'open' |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#61526 (status was 'resolved')
Searchable as RT61526$
The text was updated successfully, but these errors were encountered: