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.
 
  • Post
  • Reply
FamDav
Mar 29, 2008

Cocoa Crispies posted:

i'm talking about biginteger being in some class/struct ghetto and not first-class like machine integers

I actually have no idea what you mean.

Adbot
ADBOT LOVES YOU

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
he's talking about having to pull in a separate namespace (system.numerics) to use the BitInteger lib

but once you pull it in i don't recall it being any more difficult to use, don't they overload + and ++ and all that?

it's fairly new and i haven't really used it we use GUIDs in the one place i'd have a reason to use it

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

Suspicious Dish posted:

it's a feature so that $_GET['a'] == "2.0" works on a query string ?a=2. why that's a feature i have no idea but they won't remove it because that would break old code (hahahaha)

either you are a sperg who really doesn't understand why being able to compare those things is handy or are you just a disingenuous gently caress

FamDav
Mar 29, 2008
Oh, okay. Well in Ruby FixNum (integers) actually silently fall over to BigNum so use Ruby.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Tiny Bug Child posted:

either you are a sperg who really doesn't understand why being able to compare those things is handy or are you just a disingenuous gently caress

i understand why trying to compare those things is useful but why would you write $_GET['a'] == "2.0" instead of $_GET['a'] == 2.0

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
you wouldn't, but stuff that comes out of $_GET is a string so $_GET['a'] == 2.0 would be false (or produce a spurious error) in type nazi land even if the query string was "?a=2"

MeruFM
Jul 27, 2010
VS2012 doesn't have proper XNA4.0 support

where's my babby stick? I need to beat some bitter executives

Tiny Bug Child posted:

you wouldn't, but stuff that comes out of $_GET is a string so $_GET['a'] == 2.0 would be false (or produce a spurious error) in type nazi land even if the query string was "?a=2"

I thought PHP was weakly typed. Or does weak type just means arbitrary decisions everywhere even for primatives?

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

FamDav posted:

I actually have no idea what you mean.


Shaggar posted:

use a long or a ulong. if u got integers over that big then they need a special interger storage mechanism.

i'm saying that the special integer storage mechanism is a pain in java/c#

like you can do

Java code:
int fart = 12345;
ulong toot = 4567890;
but you can't do

Java code:
bigint asdf = 4567890876543456789098765434567890987654;
and you definitely can't

Java code:
integer asdf = 4567890876543456789098765434567890987654;
instead

Java code:
BigInteger asdf = new BigInteger("4567890876543456789098765434567890987654");

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Tiny Bug Child posted:

either you are a sperg who really doesn't understand why being able to compare those things is handy or are you just a disingenuous gently caress

tbc brought out "types are for spergs," consider this discussion closed

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
turns out computer science really is about computers after all, sorry about your garden of pure ideology bro

jooky
Jan 15, 2003

BigInteger is an object and not a primitive. why is that syntax weird wrt java or are you just complaining about its verbosity

tef
May 30, 2004

-> some l-system crap ->

Tiny Bug Child posted:

you wouldn't, but stuff that comes out of $_GET is a string so $_GET['a'] == 2.0 would be false (or produce a spurious error) in type nazi land even if the query string was "?a=2"

in perl, you do == to mean 'do they look like the same number' and eq to mean 'do these look like the same string'.

as such, you don't get the ambiguous == 'can you mash either of these to look the same as a number, or are they the same string'

fritz
Jul 26, 2003

rotor posted:

yes because there were also 0-based arrays unless you set an env var and then it was 1-based and oh god it was so bad

I heard they finally dropped that special variable in perl that controlled where arrays start at

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
seriously though i dont really think strong typing is all that important and it's usually not worth the effort imho

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

rotor posted:

seriously though i dont really think strong typing is all that important and it's usually not worth the effort imho
declaring types is a pain, duck typing rules, having busted equality sucks

Opinion Haver
Apr 9, 2007

you can write an entire haskell program without seeing a type

i mean granted if you don't at least declare the types of your top-level declarations you suck but still

homercles
Feb 14, 2010

fritz posted:

I heard they finally dropped that special variable in perl that controlled where arrays start at
code:
$ perl -E '$[ = 1; say +("a".."z")[3]'
Use of assignment to $[ is deprecated at -e line 1.
c
nope just deprecated in 5.12

gabensraum
Sep 16, 2003


LOAD "NICE!",8,1
it's interesting that we are getting so much discussion from one little common programming issue. i think this is a good exercise; i like to see the different processes people follow even at this level.

for me it depends on the language:

1. google "compare [this type] and [that type] in [computer language]"
2. find ticked stackoverflow post
3. copy
4. paste

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

homercles posted:

code:
$ perl -E '$[ = 1; say +("a".."z")[3]'
Use of assignment to $[ is deprecated at -e line 1.
c
nope just deprecated in 5.12

Probably meant Perl 6 :yosbutt:

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

rotor posted:

itll end up in django or - lmbo - actionscript

sorry you got sucked into the full retard modern web development zeitgeist

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

yaoi prophet posted:

you can write an entire haskell program without seeing a type

i mean granted if you don't at least declare the types of your top-level declarations you suck but still

Wow this sounds so relevant and applicable in my day to day work as a software developer, on software that people actually use.

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>
y do people even reply to tiny bug child lol

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>
it's pretty simple. 1. read his post 2. realize it doesn't make sense 3. keep scrolling

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

vapid cutlery posted:

y do people even reply to tiny bug child lol

because tiny bug child ownnnnns

Notorious b.s.d.
Jan 25, 2003

by Reene

Wheany posted:

because tiny bug child ownnnnns

best gimmick poster ever

posted from conkeror 19, the web browser for emacs users

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

vapid cutlery posted:

sorry you got sucked into the full retard modern web development zeitgeist

man you have no idea

Notorious b.s.d.
Jan 25, 2003

by Reene

Cocoa Crispies posted:

i'm saying that the special integer storage mechanism is a pain in java/c#

[...]

Java code:
BigInteger asdf = new BigInteger("4567890876543456789098765434567890987654");
it is both better and worse than it seems

in C# it would be:
C# code:
var adsf = new BigInteger(0)

if ( !BigInteger.tryParse("4567890876543456789098765434567890987654", adsf) )
{
 throw new BullshitException("lol this library sucks")
}
in java 8.0 or scala it would be:
code:
val adsf = BigInteger("4567890876543456789098765434567890987654")
all three languages have some type inference and are smart enough to get away from stupid C-style var declaration

but the c# system.numerics library is loving terrible, and the java.math stuff ain't so bad

c# is not a bad language but man are there some warts in that std library

Notorious b.s.d. fucked around with this message at 15:50 on Dec 18, 2012

Shaggar
Apr 26, 2006
thats if you use tryparse. you can just do

C# code:
BigInteger b = BigInteger.Parse("4567890876543456789098765434567890987654");

double sulk
Jul 2, 2010

Shaggar posted:

thats if you use tryparse. you can just do

C# code:
BigInteger b = BigInteger.Parse("4567890876543456789098765434567890987654");

lol just look at this poo poo

Shaggar
Apr 26, 2006
?

double sulk
Jul 2, 2010

gucci void main posted:

lol just look at this poo poo

whoops signed my post

just lol though at the workarounds for big numbers

Notorious b.s.d.
Jan 25, 2003

by Reene

Shaggar posted:

thats if you use tryparse. you can just do

C# code:
BigInteger b = BigInteger.Parse("4567890876543456789098765434567890987654");

much better

but the point of the exercise was to show that c# is non-stupid and has some type inference so you don't spend time typing the type twice


C# code:
var b = BigInteger.Parse("4567890876543456789098765434567890987654");

Shaggar
Apr 26, 2006
duck typing is dumb dangerous poo poo for idiots

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Notorious b.s.d. posted:

much better

but the point of the exercise was to show that c# is non-stupid and has some type inference so you don't spend time typing the type twice



typing: the worst enemy of the working programmer

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
ya users and having to specify "int x" a lot are traumatic

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
congratulations to Perl on the car insurance discount!


(25 today. thx tef for reminder)

jony neuemonic
Nov 13, 2009

Jonny 290 posted:

congratulations to Perl on the car insurance discount!


(25 today. thx tef for reminder)

i'm celebrating by trying to convince a ruby-programmer friend that no really perl is totally readable. doing the lord's work here.

Notorious b.s.d.
Jan 25, 2003

by Reene

Shaggar posted:

duck typing is dumb dangerous poo poo for idiots

it's not duck-typed: at runtime, 'b' has the static type of "BigInteger"

the compiler just inferred the type for you so you don't waste precious keystrokes

Notorious b.s.d.
Jan 25, 2003

by Reene

Jonny 290 posted:

congratulations to Perl on the car insurance discount!


(25 today. thx tef for reminder)

perl.org has no cake or nothin :(

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006
oh im using the wrong term. but yeah its bad and dumb and dangerous since the compiler cant warn you if the rhs changes resulting in runtime failures.

its bad bad bad. dont do it. the lhs must remain properly typed.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply