Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 218845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:47:21+00:00 2026-05-11T18:47:21+00:00

According to the MSDN help for VB6 Floating-point values can be expressed as mmmEeee

  • 0

According to the MSDN help for VB6

Floating-point values can be expressed as mmmEeee or mmmDeee, in which mmm is the mantissa and eee is the exponent (a power of 10). The highest positive value of a Single data type is 3.402823E+38, or 3.4 times 10 to the 38th power; the highest positive value of a Double data type is 1.79769313486232D+308, or about 1.8 times 10 to the 308th power. Using D to separate the mantissa and exponent in a numeric literal causes the value to be treated as a Double data type. Likewise, using E in the same fashion treats the value as a Single data type.

Now in the VB6 IDE I’ve tried to enter this

const MAX_DOUBLE as Double = 1.79769313486232D+308

however, as soon as I move away from that line the IDE throws an Error 6 (Overflow)

An overflow results when you try to make an assignment that exceeds the limitations of the target of the assignment. …

So how do I get MAX_DOUBLE (and MIN_DOUBLE for that matter) defined?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:47:22+00:00Added an answer on May 11, 2026 at 6:47 pm

    Does it have to be a Const? You can get the exact value of MAX_DOUBLE into a variable by setting the correct bit pattern using CopyMemory from a Byte array.

    Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
    
    Dim Max As Double
    Dim Idx As Long
    Dim Bits(0 To 7) As Byte
    
    For Idx = 0 To 5
       Bits(Idx) = 255
    Next
    Bits(6) = 239 ' = 11101111
    Bits(7) = 127
    
    For Idx = 0 To 7
       CopyMemory ByVal VarPtr(Max) + Idx, Bits(Idx), 1
    Next
    
    Debug.Print Max
    

    Edit: I forgot that you also asked about MIN_DOUBLE, which is even easier.

    Dim Min As Double
    Dim Bits As Byte
    
    Bits = 1
    CopyMemory ByVal VarPtr(Min), Bits, 1
    
    Debug.Print Min
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.