Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-02-2019, 01:58 PM
AndrewEK AndrewEK is offline
Registered User
 
Join Date: Dec 2010
Posts: 35
Divide number bigger than a long

If I do integer divide on a number bigger than a long (32 bits), I get an overflow error. Is there a way to declare a number as a double? If not, how do you do arithmetic on a number bigger than a long (32 bits)?

Example - need to divide by 2^14 to strip off lower 10 bits to get
the value in bits 11-34:

inputNum = 14417936436
newNum = inputNum \ 16384 <---- Overflow error
Reply With Quote
  #2  
Old 08-02-2019, 02:14 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,997
Hi AndrewEK,

This is more of a scripting *language* question.

This particular scripting forum is specifically set up for discussion of scripting techniques that are applicable to VanDyke Software products.

Because your question is not VanDyke Software specific, you might consider posting the same question to a forum more generally focused on the scripting language you are using.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 08-02-2019, 02:48 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,997
Hi AndrewEK,

But you might try / not \.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #4  
Old 08-27-2019, 08:50 AM
gregg gregg is offline
Registered User
 
Join Date: Oct 2010
Posts: 53
As a point of reference, on v8.5.3 (64-bit version) I got 880001 with no overflow error.
Reply With Quote
Reply

Tags
divide , overflow


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 10:10 AM.