⚠️ This forum has been restored as a read-only archive so the knowledge shared by the community over many years remains available. New registrations and posting are disabled.

All times are UTC + 8 hours




Post new topic Reply to topic  [ 85 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: Maths question
PostPosted: Feb 8th, '12, 01:30 
Bordering on Legend
Bordering on Legend
User avatar

Joined: Oct 24th, '10, 17:16
Posts: 338
Gender: Male
Are you human?: Some Time
Location: Chonburi Thailand
็ำัHey! This is not math forum.
Let google make a judment.
http://www.google.co.th/search?rlz=1C1A ... %2B1%2B1*0


Top
 Profile  
Reply with quote  
    Advertisement
 
 Post subject: Re: Maths question
PostPosted: Feb 8th, '12, 01:50 
Moderator
Moderator
User avatar

Joined: May 27th, '06, 04:57
Posts: 6480
Images: 0
Gender: Male
Are you human?: I'm a pleasure droid
Location: Frederick, Maryland
Quote:
Yes, you should, most compilers even warn against this now.
MISRA and Lint, shout at you for omitting this.


Shit, we'd have 10 million lines of code that wouldn't compile if that was changed.


Top
 Profile  
Reply with quote  
 Post subject: Re: Maths question
PostPosted: Feb 8th, '12, 01:56 
Almost divorced
Almost divorced
User avatar

Joined: Nov 11th, '09, 03:13
Posts: 1004
Gender: Male
Are you human?: The top half is
Location: Chiang Mai, NW Thailand.
It wouldn't stop them compiling, what it would do is totally guarantee that the code produced would be the same regardless of the compiler used, which is why misra, lint and DO178B insist on it.


Top
 Profile  
Reply with quote  
 Post subject: Re: Maths question
PostPosted: Feb 8th, '12, 02:13 
Moderator
Moderator
User avatar

Joined: May 27th, '06, 04:57
Posts: 6480
Images: 0
Gender: Male
Are you human?: I'm a pleasure droid
Location: Frederick, Maryland
What I meant is you can set certain warnings to be compile errors (we crank them up sometimes where it makes sense and may avoid errors later) and if we set that one as an error then our code would need lots more parentheses.


Top
 Profile  
Reply with quote  
 Post subject: Re: Maths question
PostPosted: Feb 8th, '12, 02:22 
Bordering on Legend
Bordering on Legend
User avatar

Joined: Feb 7th, '12, 02:34
Posts: 460
Location: Smithfield, North Carolina
Gender: Male
Are you human?: Yes
Location: North Carolina
I assume you guys do like beer?
After few Australian beer, it can be whatever you want it to be.
So, go ahead and have few more. Then maybe 13


Top
 Profile  
Reply with quote  
 Post subject: Re: Maths question
PostPosted: Feb 8th, '12, 02:23 
Almost divorced
Almost divorced
User avatar

Joined: Nov 11th, '09, 03:13
Posts: 1004
Gender: Male
Are you human?: The top half is
Location: Chiang Mai, NW Thailand.
Yup, I have had a number of contracts that have been to turn old "unsafe" code into "safe" code.
Parentheses are usually the first step.


Top
 Profile  
Reply with quote  
 Post subject: Re: Maths question
PostPosted: Feb 8th, '12, 08:40 
Moderator
Moderator
User avatar

Joined: Mar 24th, '10, 13:00
Posts: 5086
Gender: Male
Are you human?: Daughters think not
Location: Horsham, Victoria, Australia
yep I would go with 13


Top
 Profile  
Reply with quote  
 Post subject: Re: Maths question
PostPosted: Feb 8th, '12, 08:51 
Legend Member
Legend Member
User avatar

Joined: Nov 2nd, '11, 10:14
Posts: 860
Images: 16
Gender: Male
Are you human?: yes
Location: South lake, Perth, Australia
yep +1 for 13...


Top
 Profile Personal album  
Reply with quote  
 Post subject: Re: Maths question
PostPosted: Feb 8th, '12, 12:19 
Almost divorced
Almost divorced

Joined: May 30th, '11, 16:27
Posts: 1109
Gender: Male
Are you human?: yes
Location: Baldivis WA
This isnt interesting.
This reminds me of people that still think the world is flat.
The answer is 13.
There is no such thing as assumed brackets.
We all know what happens when we assume.

There are 1+1+1*0 types of people in this world.
Those that know maths, and those that dont.


Top
 Profile  
Reply with quote  
 Post subject: Re: Maths question
PostPosted: Feb 8th, '12, 14:26 
werdna wrote:
There are 1+1+1*0 types of people in this world.
Those that know maths, and those that dont.


So Werdna... what processing steps did you take to determine the answer...

Did you add/subtract the numbers from left to right... or did you multiply the "1*0" first... and then do the rest...


Top
  
Reply with quote  
 Post subject: Re: Maths question
PostPosted: Feb 8th, '12, 14:46 
Almost divorced
Almost divorced

Joined: May 30th, '11, 16:27
Posts: 1109
Gender: Male
Are you human?: yes
Location: Baldivis WA
I followed the bimdas rule.
Calculate inside brackets first.
Then Indices
Then Multiplication and Division.
Then Addition and Subtraction.

If you want to test the rule, go into Excel, click on a cell, and type =1+1+1*0.
If the cell result is 0, I am wrong, but you will get a 2.
It is basic maths.


Top
 Profile  
Reply with quote  
 Post subject: Re: Maths question
PostPosted: Feb 8th, '12, 15:00 
So.. as there were no brackets, or indices.. in the example... you multiplied the 1*0 first... then did the addition and subtraction...

ie... 1+1+1+1+1+1+1+1+1+1-1+1+1+1+1+(1*0)
ie..............you did this part first.... :headbang:

Or even last.... Assuming there was effectively a "bracket".... :wink:

And yes, I'm sure, and not disputing... that computational calculators, and spreadsheets...

All follow the same rule.... which assumes/implies... a bracketed order of operation... the multiplication first... :wink:

The same example could have been written.... as above... and would have been totally unambigouous...


Top
  
Reply with quote  
 Post subject: Re: Maths question
PostPosted: Feb 8th, '12, 15:21 
Moderator
Moderator
User avatar

Joined: May 6th, '11, 12:06
Posts: 12206
Gender: Male
Location: Northern NSW
1110001111000111010110101010101


Top
 Profile  
Reply with quote  
 Post subject: Re: Maths question
PostPosted: Feb 8th, '12, 15:29 
Almost divorced
Almost divorced

Joined: May 30th, '11, 16:27
Posts: 1109
Gender: Male
Are you human?: yes
Location: Baldivis WA
RupertofOZ wrote:
The same example could have been written.... as above... and would have been totally unambigouous...

It could have, but where is the fun in that?
There are less rules in maths than english, yet we seem to be able to follow them easily enough... most of the time.

Charlie wrote:
1110001111000111010110101010101

What does 14927706 have to do with anything? :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Maths question
PostPosted: Feb 8th, '12, 16:32 
A posting God
A posting God
User avatar

Joined: Oct 16th, '11, 06:12
Posts: 2019
Gender: Male
Are you human?: 0110010110
Location: Brisbane, qld
This whole argument is over word definition or personal application of word definitions, not math rules !


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 85 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC + 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group
Portal by phpBB3 Portal © phpBB Türkiye
[ Time : 0.085s | 14 Queries | GZIP : Off ]