# Invert Signed Numerical

Email
 Submitted on: 8/11/2018 4:37:45 PM By: Nicholas Forystek Level: Intermediate User Rating: Unrated Compatibility: VB 6.0 Views: 1916

This is a invert function that, I am unsure is 100% accurate, but appears for the lower memory definitions of integer as such that it is inverting, however the whole basis container is considerably the incremental signed value of the unsigned input.

code:
Can't Copy and Paste this?
 ``` '************************************** ' Name: Invert Signed Numerical ' Description:This is a invert function that, I am unsure is 100% accurate, but appears for the lower memory definitions of integer as such that it is inverting, however the whole basis container is considerably the incremental signed value of the unsigned input. ' By: Nicholas Forystek '************************************** Public Function Invert(ByVal Value As Variant, Optional ByVal Whole As Variant = Empty) As Variant ' _ Inverts the Value based ona Whole, unspecified integers invert in 32767 and longs in 2147483647, and, Invert(25, 100)=75 If TypeName(Whole) = "Empty" Then Select Case TypeName(Value) Case "Byte" Value = -1 - CDbl(CDbl(-CDbl(125) + -(CDbl(Value) - 1) + CDbl(CDbl(125) * CDbl(2)))) Case "Integer", "Boolean" Value = -1 - CDbl(CDbl(-CDbl(32677) + -(CDbl(Value) - 1) + CDbl(CDbl(32677) * CDbl(2)))) Case "Long", "Single" Value = -1 - CDbl(CDbl(-CDbl(1073741824) + -(CDbl(Value) - 1) + CDbl(CDbl(1073741824) * CDbl(2)))) Case "Double", "Currency" Value = -1 - CDbl(CDbl(-CDbl(125) + -(CDbl(Value) - 1) + CDbl(CDbl(125) * CDbl(2147483645)))) Case Else Value = -125 - CDbl(CDbl(-CDbl(32765) + -(CDbl(Value) - 125) + CDbl(CDbl(32765) * CDbl(2147483645)))) End Select Else Value = CDbl(-CDbl(Whole) + -CDbl(Value)) + CDbl(CDbl(Whole) * CDbl(2)) End If Invert = Value End Function```

Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)