[julia-users] Re: Int or Int64

2016-04-17 Thread Kristoffer Carlsson
Because of what Mauro said above.

On Sunday, April 17, 2016 at 8:07:39 PM UTC+2, Christoph Ortner wrote:
>
> Why is there no `Float`? Is this discussed somewhere?
>


[julia-users] Re: Int or Int64

2016-04-17 Thread Christoph Ortner
Why is there no `Float`? Is this discussed somewhere?


[julia-users] Re: Int or Int64

2016-04-16 Thread Páll Haraldsson
On Wednesday, April 13, 2016 at 9:27:00 AM UTC, Bill Hart wrote:
>
> Int is either Int32 or Int64, depending on the machine. Int64 does still 
> seem to be defined on a 32 bit machine. In fact, even Int128 is defined.
>

Yes, this is all safe when you only have one thread, but if you plan for 
the future (threads in Julia), I wander if only Int64 on 32-bit (and 
Int128, on 32- and 64-bit) is unsafe, as it is non-atomic:

http://preshing.com/20130618/atomic-vs-non-atomic-operations/

See there "torn write". I saw a little surprised that all accesses in C/C++ 
can be non-safe.. so maybe that also applies to Julia.

Do I worry to much, as locks would be the way (or "lock-free"), to guard 
against non-atomic?

If you need big numbers keep BigNum in mind that I think should always be 
safe.

But of course it is going to have to emulate processor instructions to do 
> 64 bit arithmetic unless the machine actually has such instructions. So it 
> could well be quite a bit slower.
>
> On Wednesday, 13 April 2016 11:09:27 UTC+2, vincent leclere wrote:
>>
>> Hi all,
>>
>> quick question: I am building a package and has been defining types with 
>> Int64 or Float64 properties.
>> Is there any reason why I should be using Int and Float instead ? (Does 
>> Int64 work on 32bits processors ?)
>> Will it be at the price of efficiency loss ?
>>
>> Thanks
>>
>

[julia-users] Re: Int or Int64

2016-04-13 Thread Scott Jones
There is no Float, you should use Float32 or Float64 depending on precision 
needed for your application.
I'd definitely use Int instead of Int64 as long as Int32 will be large 
enough, to avoid performance issues on 32-bit machines.
(I build and use Julia on my 32-bit ARM based Raspberry Pi)

On Wednesday, April 13, 2016 at 5:09:27 AM UTC-4, vincent leclere wrote:
>
> Hi all,
>
> quick question: I am building a package and has been defining types with 
> Int64 or Float64 properties.
> Is there any reason why I should be using Int and Float instead ? (Does 
> Int64 work on 32bits processors ?)
> Will it be at the price of efficiency loss ?
>
> Thanks
>


[julia-users] Re: Int or Int64

2016-04-13 Thread 'Bill Hart' via julia-users
Int is either Int32 or Int64, depending on the machine. Int64 does still 
seem to be defined on a 32 bit machine. In fact, even Int128 is defined. 
But of course it is going to have to emulate processor instructions to do 
64 bit arithmetic unless the machine actually has such instructions. So it 
could well be quite a bit slower.

On Wednesday, 13 April 2016 11:09:27 UTC+2, vincent leclere wrote:
>
> Hi all,
>
> quick question: I am building a package and has been defining types with 
> Int64 or Float64 properties.
> Is there any reason why I should be using Int and Float instead ? (Does 
> Int64 work on 32bits processors ?)
> Will it be at the price of efficiency loss ?
>
> Thanks
>