dcsimg
Results 1 to 35 of 35

Thread: Exporting numerical data

  1. #1

    Thread Starter
    Banned
    Join Date
    Aug 2018
    Posts
    15

    Question Exporting numerical data

    First, let me ask...every forum I have been to to ask questions, everyone treats you rudely...or berates you in some way. If this is the case with this forum, please let me know right off the bat, so I can remove myself from it.

    My question: I have numerical data from visual basic 2017 that I would like to save to a file. However, being a beginner at programming, the book only talks about saving to text files. I would like to use the save dialog box to save the numerical data as numerical data in a file. I don't want the file converting the numbers to strings. Is there any solution that anyone is aware of even if I don't use the save dialog box? Thank you in advance for those willing to 'truly' help.

  2. #2
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    2,088

    Re: Exporting numerical data

    Hi,

    you could use a Database (Access mySql etc...)

    But you can save numbers to a Textfile also

    here a small and simple example

    create a Form with three Textboxes and a Button..

    Code:
    Imports System.IO
    
    Public Class Form1
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            TextBox1.Text = "1.253,12"
            TextBox2.Text = Now
            TextBox3.Text = "IP.-00001222"
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
            Dim path As String = "C:\"
            Dim Filename As String = "LogF.txt"
            Path = String.Concat(Path, Filename)
    
            Call SaveFileForAppend(path)
            Process.Start(path)
        End Sub
        Private Sub SaveFileForAppend(ByVal Filename As String)
            Dim sw As System.IO.StreamWriter
    
            Try
                'add Text to the File C:\LogF.txt
                If System.IO.File.Exists(Filename) Then
                    sw = System.IO.File.AppendText(Filename)
                Else
                    'write to a new File
                    sw = System.IO.File.CreateText(Filename)
                End If
                With sw
                    .Write(TextBox1.Text & System.Environment.NewLine)
                    .Write(TextBox2.Text & System.Environment.NewLine)
                    .Write(TextBox3.Text & System.Environment.NewLine)
                    .Flush()
                    .Close()
    
                End With
            Catch ex As IOException
                MessageBox.Show(ex.Message.ToString())
            End Try
    
    
        End Sub
    End Class
    regards
    Chris
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

  3. #3

    Thread Starter
    Banned
    Join Date
    Aug 2018
    Posts
    15

    Re: Exporting numerical data

    Using streamwriter to write the file to the text file saves the numerical data as a string. I want a file that saves the data as numerical data. For instance a "double" takes up only 8 bytes whereas if I was to save this in a text file...each number is saved as a character which takes one byte per character. So the number 10000000000000 requires several bytes as a string vs. saving the number as a number which would be 8 bytes. I basically need something like Notepad, but instead of saving text, I need it to save numerical data correctly and not as strings.

  4. #4
    Frenzied Member
    Join Date
    Dec 2014
    Location
    VB6 dinosaur land
    Posts
    1,191

    Re: Exporting numerical data

    You want to use the BinaryWriter class.
    Code:
            Dim temp As Double = 10000000000000
    
            ' Create the BinaryWriter and use File.Open to create the file.
            Using writer As BinaryWriter = New BinaryWriter(File.Open("file.bin", FileMode.Create))
                writer.Write(temp)
            End Using
    will give you an 8 byte file.

  5. #5
    Fanatic Member kpmc's Avatar
    Join Date
    Sep 2017
    Posts
    1,013

    Re: Exporting numerical data

    Im not sure about the logistics/efficiency of the matter, but XML would probably be the easiest solution whereas you can define the schema as needed

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,203

    Re: Exporting numerical data

    Another option would be a binary serialized file, but that would be based on lots of unwarranted assumptions. Binary serialization works best for saving a class that has a bunch of fields in it (which can be numbers, strings, or otherwise). It would be overkill for saving just one number, but if you have a bunch of them, then it becomes an option. The other issue with such a file is that it can't be opened by just anything, but it isn't clear whether or not that matters, either.

    One question, though: Why do you care what format the file is saved as?

    Text representations are pretty common, and that shouldn't be a surprise. Text representations of numbers abound in programming. When you enter a number in a textbox or even a NumericUpDown control, you are entering text. Sure, it may end up being a number, but you're entering a text representation. Lots of web communication is currently done via text representations, such as JSON, most XML, and HTML. Some other network communication is not text representation, but so much is that avoiding it can be tricky. That's why I ask why you want to avoid it.
    My usual boring signature: Nothing

  7. #7

    Thread Starter
    Banned
    Join Date
    Aug 2018
    Posts
    15

    Re: Exporting numerical data

    Name:  Screen Shot 2018-08-31 at 7.40.40 AM.png
Views: 85
Size:  28.9 KB
    So I wrote the double to a binary file as you suggested but got a 308 byte file versus an 8 byte file. Suggestions?

  8. #8

    Thread Starter
    Banned
    Join Date
    Aug 2018
    Posts
    15

    Re: Exporting numerical data

    I'm a beginner, I wouldn't even know where to start with XML. But thanks for the suggestion. It would be nice to have something like notepad that I could just write numerical data to but it would save as numerical data as numbers take up less space than strings.

  9. #9
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    5,508

    Re: Exporting numerical data

    Quote Originally Posted by Student_Begginner View Post
    Name:  Screen Shot 2018-08-31 at 7.40.40 AM.png
Views: 85
Size:  28.9 KB
    So I wrote the double to a binary file as you suggested but got a 308 byte file versus an 8 byte file. Suggestions?
    What code did you use? I tried this, and the size is 8 byte, shown in powershell, and the properties dialog of the file.
    Code:
    Imports System.IO
    
    Public Class Form1
    
      Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim temp As Double = 10000000000000
    
        ' Create the BinaryWriter and use File.Open to create the file.
        Using writer As BinaryWriter = New BinaryWriter(File.Open("c:\c\file.bin", FileMode.Create))
          writer.Write(temp)
        End Using
      End Sub
    End Class
    Name:  filebinsize.jpg
Views: 83
Size:  19.2 KB

  10. #10

    Thread Starter
    Banned
    Join Date
    Aug 2018
    Posts
    15

    Re: Exporting numerical data

    I used the code you showed me but with my variables. My number is 76 digits long. But according to my book, a number can go out to 308 digits and still be 8 bytes in length.

    Quote Originally Posted by passel View Post
    What code did you use? I tried this, and the size is 8 byte, shown in powershell, and the properties dialog of the file.
    Code:
    Imports System.IO
    
    Public Class Form1
    
      Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim temp As Double = 10000000000000
    
        ' Create the BinaryWriter and use File.Open to create the file.
        Using writer As BinaryWriter = New BinaryWriter(File.Open("c:\c\file.bin", FileMode.Create))
          writer.Write(temp)
        End Using
      End Sub
    End Class
    Name:  filebinsize.jpg
Views: 83
Size:  19.2 KB

  11. #11
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    5,508

    Re: Exporting numerical data

    Just to let you know, I changed the code to what is below and verified after clicking the button the file was 24-bytes in size. I then removed one of the writes and verified the file was 16-bytes, and finally back to one write and the file size was 8-bytes again.
    Code:
    Imports System.IO
    
    Public Class Form1
    
      Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim temp As Double = 10000000000000
    
        ' Create the BinaryWriter and use File.Open to create the file.
        Using writer As BinaryWriter = New BinaryWriter(File.Open("c:\c\file.bin", FileMode.Create))
          writer.Write(temp)
          writer.Write(temp)
          writer.Write(temp)
        End Using
      End Sub
    End Class

  12. #12
    Fanatic Member
    Join Date
    Nov 2017
    Posts
    826

    Re: Exporting numerical data

    A lot of the times, responses that are interpreted as being rude are because a poster asks for assistance, code is posted to help them, and then they come back and say "It didn't work." And then, after a significant back-and-forth, the poster finally posts the code that they tried and it ends up being significantly different than the code that was suggested, and much flailing of arms ensues by those attempting to help.

    You say you used the suggested code, but with your variables, which means you changed the code. How you changed the code might explain the results you are seeing.

    So please post the exact code you are using so it can be examined.

  13. #13

    Thread Starter
    Banned
    Join Date
    Aug 2018
    Posts
    15

    Re: Exporting numerical data

    I got it now. I forgot to convert the string into a double which I thought I had already done. MUCH GRATITUDE AND THANKS TO EACH AND EVERY ONE OF YOU.

    Quote Originally Posted by Student_Begginner View Post
    I used the code you showed me but with my variables. My number is 76 digits long. But according to my book, a number can go out to 308 digits and still be 8 bytes in length.

  14. #14

    Thread Starter
    Banned
    Join Date
    Aug 2018
    Posts
    15

    Re: Exporting numerical data

    Much gratitude and thanks to everyone here.

  15. #15
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    5,508

    Re: Exporting numerical data

    Quote Originally Posted by Student_Begginner View Post
    I used the code you showed me but with my variables. My number is 76 digits long. But according to my book, a number can go out to 308 digits and still be 8 bytes in length.
    Well, I'm not sure exactly what they are trying to say. I suppose it depends on how the number is printed, and interpreted upon input. The Double can handle a magnitude of up to around 10^308, but the number of actually significant digits will be much less. It is actually based on around 50 some bits of Mantissa so only particular combinations of digits in base 10 will extend out to a list of digits.
    In any case, it shouldn't matter how many digits you provide. The number will be rounded to the best base 2 Mantissa it can achieve, and will be stored with an exponent in base 2, and that will all fit in the 8-byte format of the double. So only 8-bytes should be stored. If you're getting more bytes, then you aren't using the same code. You can post the code you're actually using, rather than saying you're using the same code we posted.

    p.s. I guess you guys already covered the code issue while I was composing, so the request is n/a. (Not Applicable).

  16. #16

    Thread Starter
    Banned
    Join Date
    Aug 2018
    Posts
    15

    Re: Exporting numerical data

    Thanks, but I posted where I corrected my error. I forgot to convert the string to a double which I thought I had already done. The file is now 8 bytes. Thanks though.

  17. #17
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,203

    Re: Exporting numerical data

    I'm still curious as to why you care. Even more curious because you stated repeatedly that you are a beginner.

    When I was starting out, 8 bytes vs 300 bytes was a BIG deal. Partly, that was because memory was such a scarce commodity back in the days of DOS. These days, a few hundred bytes doesn't matter to anybody. The binary serialization tacks a bit of extra information onto files, which increases their size. XML adds tags for formatting, which can triple the size of the file. Some would call it bloat, but most just don't care. The first computer I bought had 2MB RAM and a 44 MB HD. I thought I was pretty cool, as I had never seen an HD that large before. and few people had more than 1MB RAM (most programs of the day couldn't even see that second MB, so it wasn't all that useful). These days...it's all GB and larger.
    My usual boring signature: Nothing

  18. #18

    Thread Starter
    Banned
    Join Date
    Aug 2018
    Posts
    15

    Re: Exporting numerical data

    Well, what does 5 GB down to 519 MB mean to you if you have limited resources?

    Quote Originally Posted by Shaggy Hiker View Post
    I'm still curious as to why you care. Even more curious because you stated repeatedly that you are a beginner.

    When I was starting out, 8 bytes vs 300 bytes was a BIG deal. Partly, that was because memory was such a scarce commodity back in the days of DOS. These days, a few hundred bytes doesn't matter to anybody. The binary serialization tacks a bit of extra information onto files, which increases their size. XML adds tags for formatting, which can triple the size of the file. Some would call it bloat, but most just don't care. The first computer I bought had 2MB RAM and a 44 MB HD. I thought I was pretty cool, as I had never seen an HD that large before. and few people had more than 1MB RAM (most programs of the day couldn't even see that second MB, so it wasn't all that useful). These days...it's all GB and larger.

  19. #19
    Fanatic Member kpmc's Avatar
    Join Date
    Sep 2017
    Posts
    1,013

    Re: Exporting numerical data

    Quote Originally Posted by Shaggy Hiker View Post
    I'm still curious as to why you care. Even more curious because you stated repeatedly that you are a beginner.

    (most programs of the day couldn't even see that second MB, so it wasn't all that useful).
    You could allocate much of the drivers and operating resources to the highmem so that these programs wouldnt need to see it. I was like 12 years old when we were all fiddling with COnfig.sys and autoexex. Even before this my first 'harddrive' was a cassette tape that failed frequently. As we are going down memory lane, I cant even remember a day that I was not being productive behind a keyboard.

  20. #20

    Thread Starter
    Banned
    Join Date
    Aug 2018
    Posts
    15

    Re: Exporting numerical data

    By the way...thanks for this...any chance you know how to convert it back into the correct readable format? So you saved 1000000000 to a .bin file. When you import it back into VB....how do you get the same number. When I import a large number it comes back like 1.00000000+E308

    Quote Originally Posted by topshot View Post
    You want to use the BinaryWriter class.
    Code:
            Dim temp As Double = 10000000000000
    
            ' Create the BinaryWriter and use File.Open to create the file.
            Using writer As BinaryWriter = New BinaryWriter(File.Open("file.bin", FileMode.Create))
                writer.Write(temp)
            End Using
    will give you an 8 byte file.

  21. #21
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,203

    Re: Exporting numerical data

    Quote Originally Posted by Student_Begginner View Post
    Well, what does 5 GB down to 519 MB mean to you if you have limited resources?
    I would say that it means that you are storing a whole lot more than just a double, which may well change the best answer. If you are saving one, then it makes little difference, if you are saving a lot, then binary serialization becomes a viable solution. That's why I was asking. Saving one floating point value saves a bit of space, but a largely meaningless amount. Saving a whole bunch of floating point values will end up saving quite a bit of space, but you also have other means of saving them that are worth considering.
    My usual boring signature: Nothing

  22. #22
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    5,508

    Re: Exporting numerical data

    Quote Originally Posted by Student_Begginner View Post
    By the way...thanks for this...any chance you know how to convert it back into the correct readable format? So you saved 1000000000 to a .bin file. When you import it back into VB....how do you get the same number. When I import a large number it comes back like 1.00000000+E308
    So, you want a 1 followed by 308 zeros? Won't that be hard to read?

    If on the other hand you have a number like:
    12340987410987324897614239128763249812346.4091283709423076
    when stored as a double in has to be converted to a floating point representation that will fit in 8-bytes. Floating point is essentially a representation similar to the scientific notation you learned in school, i.e. a mantissa and an exponent. (a number multiplied by some power of 10). In the computer's case it is a base 2 number multiplied by some power of 2.
    So, when the above number gets converted to a base2 number raised to a power of 2 and stored, and then displayed as a base 10 number, it will display as the nearest base 10 number raised to a power of 10 that it can.
    In this case, that would probably be 1.2340987410987324+40.
    You'll get between 16 and 17 base 10 digits of precision out of the mantissa.

    You can write a function to take the exponent (40) and if it exceeds the number of digits in your mantissa, just remove the decimal point and add the number of 0's to the end of the string to give you the 40 digits after where the decimal point was originally, i.e. so
    Code:
    12340987410987324897614239128763249812346.4091283709423076
    becomes
    12340987410987324000000000000000000000000
    You won't get your original number back if it contains more than 16 significant digits. And with fractional numbers, it will probably be less than 16 digits that you would see a difference since you're dealing with a base 10 to base 2 conversion and then back to base 10. A number like 0.1 in base 10 can't be represented exactly in a double because .1 is a never ending sequence of digits in base 2, so will get cut off after 50 some digits.

  23. #23

    Thread Starter
    Banned
    Join Date
    Aug 2018
    Posts
    15

    Re: Exporting numerical data

    Which is exactly why I need a format that can store the exact number I put in and be able to read it. Hells Bells.

  24. #24

    Thread Starter
    Banned
    Join Date
    Aug 2018
    Posts
    15

    Re: Exporting numerical data

    Actually, I just want to save a very large integer and a double can hold a large integer without the decimal and give you back the correct number in VB. It's necessary that I have the 308 digits or MORE to store a large integer. 302 is the minimum number of digits.

    Quote Originally Posted by Shaggy Hiker View Post
    I would say that it means that you are storing a whole lot more than just a double, which may well change the best answer. If you are saving one, then it makes little difference, if you are saving a lot, then binary serialization becomes a viable solution. That's why I was asking. Saving one floating point value saves a bit of space, but a largely meaningless amount. Saving a whole bunch of floating point values will end up saving quite a bit of space, but you also have other means of saving them that are worth considering.

  25. #25
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,236

    Re: Exporting numerical data

    If the exact number matters to you, you cannot use a floating-point number (which includes the data types Double and Single), so you need to use something else - such as Integer/Long (for whole numbers), or something like Decimal (for numbers with decimal places).

    The other data types take more memory/disk size to enable the same range of numbers, and tend to run slower, but they give accuracy.

    Quote Originally Posted by Student_Begginner View Post
    Actually, I just want to save a very large integer and a double can hold a large integer without the decimal and give you back the correct number in VB. It's necessary that I have the 308 digits or MORE to store a large integer. 302 is the minimum number of digits.
    In that case it sounds like the built-in data types wont be good enough... the "biggest" accurate data type is Decimal, which can only hold up to +/-7.9 E+28
    https://docs.microsoft.com/en-us/dot...ce/data-types/

    So, you need to find a large-number data type somewhere... I have seen some on the forums over the years, but have never needed one myself so don't have any recommendations. I suggest searching this site (or if that fails, the web) to find one that is suitable for your requirements.

  26. #26
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    4,229

    Re: Exporting numerical data

    Ok Student I'll bite, what could a 302 digit represent? Only thing I could think of is Plank Time (5.39 10 −44 s.) or maybe the size of the universe.

  27. #27

    Thread Starter
    Banned
    Join Date
    Aug 2018
    Posts
    15

    Re: Exporting numerical data

    Well, wes4dbt...that completely flew right over my head...because I'm not that intelligent. However, if you find some meaning in this picture that I created...you can message me privately. And if your gonna bite...do it right...nibble on the ear....slight bite to the neck....Oh...did I say that out loud... JKName:  HolyG.jpg
Views: 64
Size:  31.7 KB

  28. #28
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,203

    Re: Exporting numerical data

    For a truly large integer, which really IS an integer, consider the BigInteger structure:

    https://docs.microsoft.com/en-us/dot...ramework-4.7.2

    This is a structure that can hold an integer of very large size (note that it says no theoretical upper or lower size, but there has to be SOME limit, depending on memory). What I don't know is how this will save. If you save an integer as a string, you'd have one byte per digit, which you already know is not all that efficient. I've seen an implementation of something like BigInteger that stored the actual value as a string of bytes in that fashion, but I would expect that BigInteger itself stores the data more efficiently than that, and may well write out more efficiently than that (as long as you don't store the .ToString representation). Exactly how it is stored I don't know, but they would likely store it as an array of bytes. Every integer can be seen as either Hex or Decimal. We are used to Decimal, which doesn't fit into bytes all that efficiently, but Hexadecimal fits very nicely into a byte. Every byte holds two digits of Hex, which would be quite compact, and would allow math on such a byte array to be fairly straightforward. For that reason, I would assume that BigInteger is storing the number as a particularly efficient array of bytes of whatever size is needed. As long as you can store/retrieve that array of bytes, then BigInteger would be exactly what you would want, as it would be the most compact and correct means to store/recover very large integers.

    I guess I should add that, if that assumption is correct, what you would see in your file would be a Hex string (0-9 plus A-F). That shouldn't matter much, if compact is the primary goal. If you wanted to be able to edit the file by hand, that would be a bit trickier
    Last edited by Shaggy Hiker; Aug 31st, 2018 at 07:07 PM.
    My usual boring signature: Nothing

  29. #29

    Thread Starter
    Banned
    Join Date
    Aug 2018
    Posts
    15

    Re: Exporting numerical data

    Hurray!!!!!!!! SUCCESS AT FAILURE! Thanks guys!

  30. #30
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    4,229

    Re: Exporting numerical data

    You haven't failed, you've successfully found several ways that wont work.

    As for your response, sorry that image has no significant meaning to me, I understand the words. So I still have no idea what your trying to achieve or why. But that's ok, I can live with that.

  31. #31
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,585

    Re: Exporting numerical data

    Quote Originally Posted by Student_Begginner View Post
    Hurray!!!!!!!! SUCCESS AT FAILURE! Thanks guys!
    if you have acted in similar odd manner in other forums, it would be no surprise you have gotten (eventually) attitude in response. Anyway i am going to be as clear as humanly possible. It's not straightforward to do what you want, and you aren't actually explaining anything at all. It's normal to tell us what you've tried and supply your code and a usage scenario instead of flirting and posting frankly confusing images. There is only one scenario that fits all you have said. You're doing a homework assignment. Or maybe you are trying to pass a coding challenge such as at Project Euler. In either case it's unethical to give you complete code. All i can do is repeat another answer and tell you to use the BigInteger from .net 4.0. As a side note, while documentation claims a double can store 308 digits, it also notes that it is only accurate to about 20 of them. BigInteger was designed specifically for saving ultra-huge numbers. In the real world there are literally no use case scenarios that would require that precision. That number could hold the distance of the sun to the earth in millimeters.

  32. #32
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    2,088

    Re: Exporting numerical data

    Quote Originally Posted by Student_Begginner View Post
    Well, wes4dbt...that completely flew right over my head...because I'm not that intelligent. However, if you find some meaning in this picture that I created...you can message me privately. And if your gonna bite...do it right...nibble on the ear....slight bite to the neck....Oh...did I say that out loud... JKName:  HolyG.jpg
Views: 64
Size:  31.7 KB
    the only meaning in this Picture that I could think of is that you have a strange mind, and a 1TB Harddrive cost's (in Germany) 50,00€

    regards
    Chris
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

  33. #33

    Thread Starter
    Banned
    Join Date
    Aug 2018
    Posts
    15

    Re: Exporting numerical data

    I do apologize. Clearly you didn't see the JK....which means just kidding(aka joke) in that I was trying to inject some humor into the fact that you said you'll bite(byte) or the irony that your statement flew over my head and I'm not intelligent enough to understand it but the picture(made of bytes) does have some intelligent meaning behind it from my puny IQ.. Oh I figured out the double only holding x amount of digits.....it took me a while...see I'm not that intelligent. But no one need worry. I won't be returning to this forum or any other. Again, I apologize if you thought I was flirting. Firstly, from my perspective, why would I flirt with someone who could actually be like 60 years old and 300 lbs. because everyone is pretty much anonymous. I thought that would be common sense. I don't even know if your male or female. But...ok then...thanks for your answers.

    Quote Originally Posted by Lord Orwell View Post
    if you have acted in similar odd manner in other forums, it would be no surprise you have gotten (eventually) attitude in response. Anyway i am going to be as clear as humanly possible. It's not straightforward to do what you want, and you aren't actually explaining anything at all. It's normal to tell us what you've tried and supply your code and a usage scenario instead of flirting and posting frankly confusing images. There is only one scenario that fits all you have said. You're doing a homework assignment. Or maybe you are trying to pass a coding challenge such as at Project Euler. In either case it's unethical to give you complete code. All i can do is repeat another answer and tell you to use the BigInteger from .net 4.0. As a side note, while documentation claims a double can store 308 digits, it also notes that it is only accurate to about 20 of them. BigInteger was designed specifically for saving ultra-huge numbers. In the real world there are literally no use case scenarios that would require that precision. That number could hold the distance of the sun to the earth in millimeters.

  34. #34
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,203

    Re: Exporting numerical data

    Don't go putting yourself down all the time. It's kind of annoying, because anybody who is here, working on a program, even if just starting out, is no idiot.

    However, I'm not clear on what the situation currently is. The BigInteger seems better suited to your needs than packing data into a double, but it sounds like you have saving of the double working correctly....or does that previous post mean that you don't?
    My usual boring signature: Nothing

  35. #35
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    4,229

    Re: Exporting numerical data

    Student,

    Your reply to my post didn't bother me and I didn't take it as flirting, I took it as a joke. btw - I'm actually 64 and 185lbs. But Lord Orwell is correct on his other points. You haven't posted any of your code and I still can't figure out if your wanting to store just 1 308 digit number or several. So this will be post #35 and we still don't have a clear explanation. If your serious about wanting hep then I think it's been made clear what you need to do.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width