1 = 1 ?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
minicooper97de
Posts: 4
Joined: Mon Sep 23, 2013 12:59 pm

1 = 1 ?

Post by minicooper97de » Mon Sep 23, 2013 1:37 pm

hi all,

i have something curious... try this in your message box:

Code: Select all

put "700901001234567890131400" into x;add 0 to x; put x

perhaps there is a reason - but i do not know - do you?

andi

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: 1 = 1 ?

Post by dunbarx » Mon Sep 23, 2013 6:19 pm

Hmmm.

I get:

700901001234567890131400

Craig Newman

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: 1 = 1 ?

Post by jmburnod » Mon Sep 23, 2013 6:37 pm

Strange result for me too
I get:

700901001234567940538368

Best
Jean-Marc
https://alternatic.ch

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: 1 = 1 ?

Post by dunbarx » Mon Sep 23, 2013 10:16 pm

I get the same output as input.

Jean-Marc, are you really getting the last third of the number mixed up?

And miniCooper. are you getting something similar? The number is 24 digits long. Does a shorter one, say 16 or 20 digits, come out as it should?

Craig

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Contact:

Re: 1 = 1 ?

Post by dave_probertGA6e24 » Tue Sep 24, 2013 2:38 am

Hi,

On both 5.5.5 and 6.1.1, I too get the messed up number. Same one as JM.

Code: Select all

put "11111111111111111" into x;add 0 to x; put x
productes: 11111111111111112

Adding 1's into there makes the output number even stranger.

I'm guessing that the eval of the string to number can't handle larger numbers properly (in the messagebox, at least)

Cheers,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: 1 = 1 ?

Post by Simon » Tue Sep 24, 2013 3:14 am

About 5 months ago this was brought up on the Dev list, there are apparently ways to work around this.
You only get 16 digits using the standard liveCode arithmetic.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

minicooper97de
Posts: 4
Joined: Mon Sep 23, 2013 12:59 pm

Re: 1 = 1 ?

Post by minicooper97de » Tue Sep 24, 2013 9:58 am

Simon wrote:About 5 months ago this was brought up on the Dev list, there are apparently ways to work around this.
You only get 16 digits using the standard liveCode arithmetic.

Simon
thanks simon, this seems to be the problem...
i have to calculate a checksum like:

700901001234567890131400 mod 97

the result in livecode: 38
the correct result: 90

very frustrating - not to get any hints or errors just an incorrct result.

anyone out there with a solution????

thanks in advance, andi

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: 1 = 1 ?

Post by jmburnod » Tue Sep 24, 2013 11:45 am

Hi Craig
Jean-Marc, are you really getting the last third of the number mixed up?
Yes

Jean-Marc
https://alternatic.ch

Post Reply