> float is consistent across 32/64 bit platforms
Not exactly
[https://gafferongames.com/post/floating_point_determinism](https://gafferongames.com/post/floating_point_determinism)/
> It is possible to get deterministic results for floating calculations across
> multiple computers provided you
* You know your requirements, so design to that. If you need more than
high(int64), then use bignum or
* The int type is different on different systems, so for your case, don't
define anything as int. Use specific int sized types like int32 or int64 (or
bignum, or ...) so that both
@Monster, somehow I can understand your standpoint about values in game.
I would consider to use libgmp but I guess you can implement limited bignum for
your use?
> I won't have a million active IDs at the same time, but I will, in total,
> over time.
high(int32) returns 2_147_483_647, i'm sure that's more than enough. But, in
any case, i can't think of many properties where you will need high values. In
that case, i'm sure it won't be a problem to
**perl** can easily search your code for `\bint\b`, where backslash-b means
"word boundary". That's easier than the special compiler option you seem to be
requesting.
I would also use **nim-msgpack** for data-interchange between client and
server, for extra type-checking and debugging.
But
@Ar
Wow, there's a lot of assumptions here...
> You have to define an interface between client and server anyway, that's the
> only place you should care.
Beyond the simple transfer of data, I also want all the computations to give
the same result (for reasons I explained earlier). I
You have to define an interface between client and server anyway, that's the
only place you should care. Regardless on whether your client/server is 32/64,
i'm sure you are not going to use every bit of an int. Say, you want to
transmit some ID field. Are you expecting to have more than a
@Libman Whether it's important to you totally depends on what you are working
on. I want to work on a (soft) real-time client/server (or more precisely
client/distributed-server) simulation (aka "game"). And I only want to send the
"commands" over the network, rather than every change that
I never had this problem, but I've heard of NASA software projects that were
commanded to use an [arbitrary precision
library](https://en.wikipedia.org/wiki/List_of_arbitrary-precision_arithmetic_software)
for absolutely positively everything numeric. I think they had an auditing
tool that
You can make `int` whatever you want per a module, just by declaring it (`type
int = ...`). But that won't change types of literals. So then you should avoid
implicit typing. Yet stdlib of coarse uses `int` (you can declare your `int` in
`system.int` ot make small wrappers for stdlib modules,
I'm currently working under the assumption that the first application I'm going
to write in Nim is going to be a client-server setup, where the client is
32-bit mobile, and the server is 64-bit Linux.
My "problem" is that I want both sides to behave in exactly the same way.
Mathematical
11 matches
Mail list logo