looks like different methods are called:

for: user=> (unchecked-multiply 25214903917 0x5DEECE66D)
this method: static public long unchecked_multiply(long x, long y){return x
* y;}


for: (unchecked-multiply seed1 0x5DEECE66D)
this method: static public Number unchecked_multiply(long x, Object
y){return multiply(x,y);}

long story short this gets called:
static public long multiply(long x, long y){
    long ret = x * y;
    if (y != 0 && ret/y != x)
        return throwIntOverflow();
    return ret;
}


On Wed, Feb 20, 2013 at 11:25 PM, John Lawrence Aspden <
aspd...@googlemail.com> wrote:

> Hi, I'm getting an unexpected exception trying to do unchecked
> arithmetic:
>
> user=> (def seed1 25214903917)
> #'user/seed1
> user=> (type seed1)
> java.lang.Long
> user=> (type 25214903917)
> java.lang.Long
> user=> (unchecked-multiply seed1 0x5DEECE66D)
> ArithmeticException integer overflow
> clojure.lang.Numbers.throwIntOverflow (Numbers.java:1388)
>
> user=> (unchecked-multiply 25214903917 0x5DEECE66D)
> 8602081037417187945
>
> Could someone explain what's going on for me?
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
Please correct me if I'm wrong or incomplete,
even if you think I'll subconsciously hate it.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to