# New Ticket Created by  Cory Spencer 
# Please include the string:  [perl #61526]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61526 >



The floor/ceiling/round math builtins were returning Num values, causing 
statements such as:

   my Int $x = round(5.4);

to fail with a type mismatch.  This patch fixes the above builtins so that 
Int values are returned as per S29.

The patch is against src/builtins/math.pir
28,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)

Reply via email to