Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
raruler
Oct 5, 2003

“Here lies a toppled god —
His fall was not a small one.
We did but build his pedestal,
A narrow and a tall one.”
hey try holding a value greater than 2,147,483,647

oh wait

you can't

Adbot
ADBOT LOVES YOU

A Pinball Wizard
Mar 23, 2005

I know every trick, no freak's gonna beat my hands

College Slice
:firstpost:

Asymmetric POSTer
Aug 17, 2005

if you really think about it

everything is just a bunch of 1s and 0s maaaaaaaaaaaaaaan

Widdiful
Oct 10, 2012

mishaq posted:

if you really think about it

everything is just a bunch of 1s and 0s maaaaaaaaaaaaaaan

your posts are closer to 0


out of 10





with 10 being good and 0 being bad







yospos bitch

Valeyard
Mar 30, 2012


Grimey Drawer

Widdiful posted:

your posts are closer to 0


out of 10





with 10 being good and 0 being bad







yospos bitch

0 out of 2 aint bad :xd:

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

Valeyard posted:

0 out of 2 aint bad :xd:

Shut up valeyard

Kathleen
Feb 26, 2013

Grimey Drawer
lol if your using anything below ieee 128 bit for floats

Ericadia
Oct 31, 2007

Not A Unicorn

mishaq posted:

if you really think about it

everything is just a bunch of 1s and 0s maaaaaaaaaaaaaaan

im the high impedance :twisted:

pram
Jun 10, 2001
unsigned ftw

who really needs negative numbers srsly

pseudopresence
Mar 3, 2005

I want to get online...
I need a computer!
Wrong idiots unsigned should only be used when doing bit twiddling, not arithmetic.

'b.. but think of all those times I need to store values that might reach over 2 billion but never reach 4 billion!' - you.

pram
Jun 10, 2001
yes i really need 2 billion negative numbers

pram
Jun 10, 2001
uint is the lords own type

Raluek
Nov 3, 2006

WUT.
you know whats my favorite thing? how how in c++ a char is signed by default. all of those negative ascii characters.

i like how.

The Management
Jan 2, 2010

sup, bitch?
signed chars are bullshit, man

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
lol if you don't use your own bespoke artisanal quaternion type

Orcs and Ostriches
Aug 26, 2010


The Great Twist
I just use COBOL. :angel:

Tin Gang
Sep 27, 2007

Tin Gang posted:

showering has no effect on germs and is terrible for your skin. there is no good reason to do it
the only programming language I know how to use is python where the ints are intfinite

Egan Yardley
Jun 11, 2010

pythons got some weird rear end typecasting

code:
s8 = (i + 2**7) % 2**8 - 2**7      // convert to signed 8-bit
u8 = i % 2**8                      // convert to unsigned 8-bit
s16 = (i + 2**15) % 2**16 - 2**15  // convert to signed 16-bit
u16 = i % 2**16                    // convert to unsigned 16-bit
s32 = (i + 2**31) % 2**32 - 2**31  // convert to signed 32-bit
u32 = i % 2**32                    // convert to unsigned 32-bit
s64 = (i + 2**63) % 2**64 - 2**63  // convert to signed 64-bit
u64 = i % 2**64                    // convert to unsigned 64-bit
:stare:

i do like how ints and longs are one and the same tho

The Management
Jan 2, 2010

sup, bitch?

Egan Yardley posted:

i do like how ints and longs are one and the same tho

nice 32-bit machine you got there

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

Egan Yardley posted:

pythons got some weird rear end typecasting

code:
s8 = (i + 2**7) % 2**8 - 2**7      // convert to signed 8-bit
u8 = i % 2**8                      // convert to unsigned 8-bit
s16 = (i + 2**15) % 2**16 - 2**15  // convert to signed 16-bit
u16 = i % 2**16                    // convert to unsigned 16-bit
s32 = (i + 2**31) % 2**32 - 2**31  // convert to signed 32-bit
u32 = i % 2**32                    // convert to unsigned 32-bit
s64 = (i + 2**63) % 2**64 - 2**63  // convert to signed 64-bit
u64 = i % 2**64                    // convert to unsigned 64-bit
:stare:

i do like how ints and longs are one and the same tho

wtf are you doing numpy or what? because smdh if you're thinking about specific integer types in vanilla python

and yeah, this was a good change from python2 to python3 (ints and longs being the same)

Egan Yardley
Jun 11, 2010

Symbolic Butt posted:

wtf are you doing numpy or what? because smdh if you're thinking about specific integer types in vanilla python

i never actually found a use case for this garbage, im just a django scrublord

flakeloaf
Feb 26, 2003

Still better than android clock

7 fs you can't say on television

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

BigInteger

raruler
Oct 5, 2003

“Here lies a toppled god —
His fall was not a small one.
We did but build his pedestal,
A narrow and a tall one.”

Raluek posted:

you know whats my favorite thing? how how in c++ a char is signed by default. all of those negative ascii characters.

i like how.

I can kinda see why it's that way though, like if you made a list of the primitive types all the other forms without modifiers are signed

The weirdest thing I can see is that char, signed char, and unsigned char are considered different and distinct types

Egan Yardley
Jun 11, 2010

BigNumber.js

code:
var girl, cum, ears, my
cum = BigNumber(420)
my = 69
ears = 2

girl = cum.minus(my).minus(ears).div(2).toPrecision(17)
girl = parseInt(girl, 10)

FamDav
Mar 29, 2008
unsigned is nice for those few times that you actually desire silent wrap around on your fixed width number type

Soricidus
Oct 21, 2010
freedom-hating statist shill
gently caress java's lack of unsigned types forever

Orcs and Ostriches
Aug 26, 2010


The Great Twist

Soricidus posted:

gently caress java forever

The Management
Jan 2, 2010

sup, bitch?
always use unsigned for things that make no sense as negative values, such as length

Pinterest Mom
Jun 9, 2009

The Management posted:

always use unsigned for things that make no sense as negative values, such as length

sounds like you haven't seen my dick

qntm
Jun 17, 2009

The Management posted:

always use unsigned for things that make no sense as negative values, such as length

or indices into strings

Mathhole
Jun 2, 2011

rot in hell, wonderbread.
long long long long long long long long long long intdick

Soricidus
Oct 21, 2010
freedom-hating statist shill

qntm posted:

or indices into strings
actually according to the universal programming language of the future, the correct data type for this purpose is a float.

PleasingFungus
Oct 10, 2012
idiot asshole bitch who should fuck off

The Management posted:

always use unsigned for things that make no sense as negative values, such as length

then you accidentally compare against a signed int (because everyone uses signed for everything, because it's the default) and life is suffering

echinopsis
Apr 13, 2004

by Fluffdaddy

pram posted:

unsigned ftw

who really needs negative numbers srsly

I prefer to maintain a separate bool to hold the sign

celeron 300a
Jan 23, 2005

by exmarx
Yam Slacker
I saw the sign

as a function return value to determine error state

if you aren't checking your compiler warnings to see if you are comparing signed and unsigned then you deserve your many hours of debugging your bad code

same if you don't check your function returns anyway

I guess you can use exceptions if you write C++ but keep that hot mess away from me

graph
Nov 22, 2006

aaag peanuts

kittenkicker posted:

I saw the sign

as a function return value to determine error state

if you aren't checking your compiler warnings to see if you are comparing signed and unsigned then you deserve your many hours of debugging your bad code

same if you don't check your function returns anyway

I guess you can use exceptions if you write C++ but keep that hot mess away from me

those lyrics dont match up :confused:

Pittsburgh Fentanyl Cloud
Apr 7, 2003


graph posted:

those lyrics dont match up :confused:

lol

celeron 300a
Jan 23, 2005

by exmarx
Yam Slacker

graph posted:

those lyrics dont match up :confused:

Go compare the sign
it'll open up your mind
by giving function results to you
it'll help you, oh oh oh oh

Adbot
ADBOT LOVES YOU

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band
https://www.youtube.com/watch?v=ma0v2pgt0mw

  • Locked thread