I am using vbscript with asp on IIS4.0 (i am not sys admin)<BR><BR>My questions I desperately need answered are:<BR><BR>How do you perform a cos/sin calculation on a value larger than Cos<BR>(2147483647)?<BR>Try it on Cos(2147483648) and you'll see what I mean<BR><BR>This saga is all part of a serial number generation script. Don't want <BR>to bore you<BR>with the details but it goes along the lines of this....<BR><BR>A key number is generated client side using a Macromedia Director app. <BR>The key number<BR>is generated using an algorithm that is replicated Server side on our<BR>website (this is what I am working on)<BR><BR>The key number may contain 8 - (unlimited) figures, but will normally be<BR>between 8-20 figures.<BR><BR>The user comes to our website, and inputs the keynumber. The keynumber is<BR>split into two seperate strings, one containing the first 5 digits of the<BR>key number, the other containing the rest.<BR><BR>The sine of the first number is taken<BR>The cos of the second number is taken<BR><BR>However, the value of the second number can be very large, it is ok if it <BR>is below 2147483647, but anyhting larger produces an error,and the number <BR>used is actually a radian value (Director uses radians<BR>in cos/sin calculations)<BR><BR>If I put the large number into a Cos calculation ( Cos(2147483648)<BR>for example) an error message is generated (don't know why...)<BR><BR>The largest integer value Cos can handle apparantley is 2147483647,<BR>It can handle scientific notation, but again, only up to 2.147483647E+9<BR><BR>I just cannot seem to get it to handle a value bigger than this!<BR><BR>Have started converting the key number from radians to degrees using:<BR><BR>dblDegrees = radInitial/(3.14159265358979323846264338327950288/180)<BR><BR>Then dividing this by 360 to get the number of complete 360's in the <BR>number. <BR><BR>degValue = dblDegrees/360<BR><BR>The code I am using to get the remainder, which is what I need for the Cos <BR>calculation goes along the lines of this:<BR><BR>PointPosition = Instr(degValue,".")<BR><BR>If PointPosition <> 0 Then<BR>strWholeNumbers = Left(degValue,(PointPosition-1))<BR>Else<BR>strWholeNumbers = degValue<BR>End If<BR><BR>This actually calculates what the remainder is:<BR><BR>degRemainder = dblDegrees - (360*strWholeNumbers)<BR><BR>and this produces the new Radian value, which is limited to something like <BR>4,<BR><BR>radNewRadians = degRemainder * (3.14159265358979323846264338327950288/180)<BR>I can then take the cos of it and Robert's your father's brother.<BR><BR>strCos = Cos(radNewRadians)<BR><BR>BUT<BR>This actually works fine, on values bigger than 2147483647 until the <BR>server automatically switches the result of degValue to scientific <BR>notation (it does this at around powers of 15), then when the remainder <BR>gets calculated using:<BR><BR>PointPosition = Instr(degValue,".")<BR>End If<BR>If PointPosition <> 0 Then<BR>strWholeNumbers = Left(degValue,(PointPosition-1))<BR>Else<BR>strWholeNumbers = degValue<BR>End If<BR><BR>It comes across something like 3.545555E+12 and takes the value 3 as the <BR>number of whole numbers and everything goes arse over tit again.<BR><BR>So I thought I had a work around the initial 2147483647, but now the <BR>scientific notation issue is buggering things up.<BR><BR>If I can now figure out some way of getting the value of the remainder, <BR>when a number such as 3.417826377723E+15 is divided by 360 then I will be <BR>OK.<BR><BR>I'll be amazed if you actually read to the bottom of this email, but <BR>thanks if you do.<BR><BR>I'm not looking for someone to solve my problem completely, I just need <BR>some advice on how to get around this, or even if it's just me having <BR>problems with it, then if it's just me I will feel a lot better (a bit <BR>thick, but nonetheless better)<BR><BR>Here's Hoping<BR><BR>Euan<BR>