Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: multiply  (Read 14628 times)

0 Members and 1 Guest are viewing this topic.

harry 48

    Topic Starter


    Egghead

  • lay back , relax and chill out
  • Thanked: 129
    • Yes
    • Yes
    • Yes
    • Dribbling Pensioner
  • Certifications: List
  • Experience: Familiar
  • OS: Windows 7
multiply
« on: August 19, 2009, 01:32:57 PM »
111,111,111 x 111,111,111 = 12,345,678,987,654,321

Aegis



    Expert

    Thanked: 67
    • Yes
    • Yes
    • Brian's Mess Of A Web Page
  • Experience: Experienced
  • OS: Windows 10
Re: multiply
« Reply #1 on: August 19, 2009, 02:32:49 PM »
What are you, some kind of genius, or something?   ;D

That's cool, anyway.


"For you, a thousand times over." - "The Kite Runner"

harry 48

    Topic Starter


    Egghead

  • lay back , relax and chill out
  • Thanked: 129
    • Yes
    • Yes
    • Yes
    • Dribbling Pensioner
  • Certifications: List
  • Experience: Familiar
  • OS: Windows 7
Re: multiply
« Reply #2 on: August 19, 2009, 02:41:30 PM »
a higher maths tutor at queens uni belfast

computeruler



    Egghead

    Thanked: 63
    • Yes
    • Yes
  • Experience: Experienced
  • OS: Mac OS
Re: multiply
« Reply #3 on: August 19, 2009, 02:50:07 PM »
Woa! Cool!

Helpmeh



    Guru

  • Roar.
  • Thanked: 123
    • Yes
    • Yes
  • Computer: Specs
  • Experience: Familiar
  • OS: Windows 8
Re: multiply
« Reply #4 on: August 19, 2009, 04:22:16 PM »
ERROR? u h4x0rz
Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.

harry 48

    Topic Starter


    Egghead

  • lay back , relax and chill out
  • Thanked: 129
    • Yes
    • Yes
    • Yes
    • Dribbling Pensioner
  • Certifications: List
  • Experience: Familiar
  • OS: Windows 7
Re: multiply
« Reply #5 on: August 19, 2009, 04:55:34 PM »
ERROR? u h4x0rz

will not calculate   ;D ::)

Helpmeh



    Guru

  • Roar.
  • Thanked: 123
    • Yes
    • Yes
  • Computer: Specs
  • Experience: Familiar
  • OS: Windows 8
Re: multiply
« Reply #6 on: August 19, 2009, 05:26:52 PM »
will not calculate   ;D ::)
I get 1.2345678987654e+16
Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.

smeezekitty

  • Guest
Re: multiply
« Reply #7 on: August 19, 2009, 05:31:05 PM »
i am thinking you did it on the computer :)

Helpmeh



    Guru

  • Roar.
  • Thanked: 123
    • Yes
    • Yes
  • Computer: Specs
  • Experience: Familiar
  • OS: Windows 8
Re: multiply
« Reply #8 on: August 19, 2009, 05:40:10 PM »
i am thinking you did it on the computer :)

iPod Touch
Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.

kpac

  • Web moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: multiply
« Reply #9 on: August 20, 2009, 04:08:47 AM »
Quote
iPod Touch
Well what a coincidence!

Quote
1.2345678987654e+16
Actually the answer you should get is 1.2345679 x10^16.

Helpmeh



    Guru

  • Roar.
  • Thanked: 123
    • Yes
    • Yes
  • Computer: Specs
  • Experience: Familiar
  • OS: Windows 8
Re: multiply
« Reply #10 on: August 23, 2009, 08:50:36 PM »
Well what a coincidence!
Actually the answer you should get is 1.2345679 x10^16.
zE+n=z*10^n
It all depends on the calculator.
Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.

mroilfield



    Mentor
  • Thanked: 42
    • Yes
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 11
Re: multiply
« Reply #11 on: August 24, 2009, 04:41:19 AM »
i am thinking you did it on the computer :)


I did mine on the computer and got the correct answer.
You can't fix Stupid!!!

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: multiply
« Reply #12 on: August 24, 2009, 05:53:27 AM »
Visual Basic, in the immediate window, First as a Single Precision calculation, then as Double Precision, and finally using the Decimal Variant subtype. :)

(note that "?n" in the immediate window is the same as "Print n")
Code: [Select]
?111111111! * 111111111!
 1.234568E+16
?111111111# * 111111111#
1.23456789876543E+16
?cdec(111111111) * cdec(111111111)
12345678987654321
I was trying to dereference Null Pointers before it was cool.

smeezekitty

  • Guest
Re: multiply
« Reply #13 on: August 24, 2009, 11:31:20 AM »
and thats why i dont use any thing based on basic

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: multiply
« Reply #14 on: August 24, 2009, 11:33:38 AM »
and thats why i dont use any thing based on basic
what's why?
I was trying to dereference Null Pointers before it was cool.

smeezekitty

  • Guest
Re: multiply
« Reply #15 on: August 24, 2009, 11:34:12 AM »
Visual Basic, in the immediate window, First as a Single Precision calculation, then as Double Precision, and finally using the Decimal Variant subtype. :)

(note that "?n" in the immediate window is the same as "Print n")
Code: [Select]
?111111111! * 111111111!
 1.234568E+16
?111111111# * 111111111#
1.23456789876543E+16
?cdec(111111111) * cdec(111111111)
12345678987654321
thats why

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: multiply
« Reply #16 on: August 24, 2009, 11:38:11 AM »
WHAT is why? WHAT reason?


that it gives an accurate result? Because it has an immediate window? Because Variant Subtypes are so scary and foreign to you and thus must be evil?
I was trying to dereference Null Pointers before it was cool.

smeezekitty

  • Guest
Re: multiply
« Reply #17 on: August 24, 2009, 11:45:46 AM »
heres a floating point calculator in C++
Code: [Select]
#include <iostream.h>
#include <stdio.h>
int main(){
float a,b;
cout<<"Enter first number:";
cin>>a;
cout<<"Enter second number";
cin>>b;
printf("\n*THE ANWSER IS:%0.4f*\n", (float) a+b);
return (-0);
}


BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: multiply
« Reply #18 on: August 24, 2009, 11:52:26 AM »
*censored* does that have to do with anything?

let me emphasis this for you- that was NOT VB6 code

Code: [Select]
Sub Main()
    Dim A,B
    A = Cdec(Val(Inputbox$("Enter first number")))
    B=  Cdec(Val(Inputbox$("Enter second number")))
    msgbox A+B
End Sub

Additionally, it has the advantage of not causing a fatal error when you enter straight text.

AND it doesn't display the results in scientific notation (due to the use of the Variant Decimal subtype).

I was trying to dereference Null Pointers before it was cool.

smeezekitty

  • Guest
Re: multiply
« Reply #19 on: August 24, 2009, 11:57:25 AM »
here is one that doesnt cause a fatal error
if the user enters junk input
Code: [Select]
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
int main(){
float fa,fb;
char a[24],b[24];
cout<<"Enter first number:";
cin>>a;
cout<<"Enter second number";
cin>>b;
fa=atof(a);
fb=atof(b);
printf("\n*THE ANWSER IS:%0.4f*\n", (float) fa+fb);
return (-0);
}

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: multiply
« Reply #20 on: August 24, 2009, 12:07:11 PM »
you completely missed my point... I ask you to fill in the fairly vague statement "and thats why i dont use any thing based on basic" and you come back and post some random C program. That tells me nothing about why you won't use anything based on BASIC it just tells me that you enjoy mixing the C++ iostream overloaded operator paradigm with the use of printf() for output thus requiring you to include both stdio and iostream into your program. Settle on printf and scanf or cout and cin, mixing the two is just a demonstration in incompetence (although in this case it's not crucial, it just seems strange to mix the two). And yes, cout DOES support output formatting, it's somewhere in the iostream namespace, I believe.

Additionally, regarding the "new" improved program with "security fixes"...

what happens if you enter 25 characters via cin?

or for that matter, what if you were to enter 24 characters into the second number, and then have some carefully conditioned output that changes the return address by overwriting the stack frame with a new return location... and making that new location point to a NOP sled leading into malicious code, namely a call to execute the local shell. If for some reason your program was run as an administrator then that crafted input now executes a shell window that has administrator privileges!

Dear me! This is even WORSE then it was before!

(of course nobody is A: going to run it as admin or B: use it as an attack vector, but when your writing code you have to consider all the possibilities, if a tiny addition program can contain such a large security hole, well, gee whiz, bigger programs don't stand a chance! (It'll be sendmail all over again....))

lol
I was trying to dereference Null Pointers before it was cool.

smeezekitty

  • Guest
Re: multiply
« Reply #21 on: August 24, 2009, 12:13:32 PM »
its just a demo my god
hackers are more intrested in writing there own programs
usual because they can get money from people
and run malicious code

kpac

  • Web moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: multiply
« Reply #22 on: August 24, 2009, 01:01:39 PM »
Quote
hackers are more intrested in writing there own programs
Don't tell me you know how to hack...

Aegis



    Expert

    Thanked: 67
    • Yes
    • Yes
    • Brian's Mess Of A Web Page
  • Experience: Experienced
  • OS: Windows 10
Re: multiply
« Reply #23 on: August 24, 2009, 01:16:51 PM »
Quote
hackers are more intrested in writing there own programs

In true hacker culture, hackers are the good guys.

Quote
usual because they can get money from people
and run malicious code

Have there been any real cases of crackers blackmailing / extorting money to keep from running their code?





"For you, a thousand times over." - "The Kite Runner"

smeezekitty

  • Guest
Re: multiply
« Reply #24 on: August 24, 2009, 02:15:35 PM »
i mean its a virus that they make money off too
for example Xp antispy virus
that some less experanced user may pay for
so its a virus and you just paid the hacker

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: multiply
« Reply #25 on: August 24, 2009, 02:23:51 PM »
that's not a virus... that's a rogue program... and they aren't developed by a single person in their basement, they're developed by teams of people in their basements.
I was trying to dereference Null Pointers before it was cool.

smeezekitty

  • Guest
Re: multiply
« Reply #26 on: August 24, 2009, 02:25:33 PM »
false postives and always starting to windows even if you uncheck auto start
sounds virusy to me

kpac

  • Web moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: multiply
« Reply #27 on: August 24, 2009, 02:27:43 PM »
Quote
sounds virusy to me
I'd get a hearing test if I were you.

smeezekitty

  • Guest
Re: multiply
« Reply #28 on: August 24, 2009, 02:32:32 PM »
i used a non word on purpose
calm down evreyone

computeruler



    Egghead

    Thanked: 63
    • Yes
    • Yes
  • Experience: Experienced
  • OS: Mac OS
Re: multiply
« Reply #29 on: August 24, 2009, 02:33:55 PM »
ya so? A rouge program and a virus are completely different, hence kpacs post

smeezekitty

  • Guest
Re: multiply
« Reply #30 on: August 24, 2009, 02:37:48 PM »
lets just put it this way
you want to get rid of them both

kpac

  • Web moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: multiply
« Reply #31 on: August 24, 2009, 03:31:26 PM »
smeezekitty, what age are you?

harry 48

    Topic Starter


    Egghead

  • lay back , relax and chill out
  • Thanked: 129
    • Yes
    • Yes
    • Yes
    • Dribbling Pensioner
  • Certifications: List
  • Experience: Familiar
  • OS: Windows 7
Re: multiply
« Reply #32 on: August 24, 2009, 03:35:27 PM »
i put in this simple post and look what it turned into a monster

smeezekitty

  • Guest
Re: multiply
« Reply #33 on: August 24, 2009, 03:36:40 PM »
i just dont agree with BC_programmer for using basic or vb

kpac

  • Web moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: multiply
« Reply #34 on: August 24, 2009, 03:38:46 PM »
i just dont agree with BC_programmer for using basic or vb
Why bring that up? Why didn't you answer my question?

smeezekitty

  • Guest
Re: multiply
« Reply #35 on: August 24, 2009, 03:40:46 PM »
guess

Salmon Trout

  • Guest
Re: multiply
« Reply #36 on: August 24, 2009, 03:41:21 PM »
smeezekitty, what age are you?

My guess is 9 to 11 (max). Judging by the maturity of his posts.

Salmon Trout

  • Guest
Re: multiply
« Reply #37 on: August 24, 2009, 03:42:18 PM »
a higher maths tutor at queens uni belfast

Like I really believe that.   ::) Student, maybe, but even that's unlikely.

kpac

  • Web moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: multiply
« Reply #38 on: August 24, 2009, 03:43:26 PM »
My guess is 9 to 11 (max). Judging by the maturity of his posts.

Well, if you were to go by maturity of posts I'd say......actually I won't say.

But yeah, that sounds like a good guess.

smeezekitty

  • Guest
Re: multiply
« Reply #39 on: August 24, 2009, 03:43:40 PM »
older

kpac

  • Web moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: multiply
« Reply #40 on: August 24, 2009, 03:44:32 PM »
12?

Salmon Trout

  • Guest
Re: multiply
« Reply #41 on: August 24, 2009, 03:45:30 PM »
smeezekitty, I have seen some annoying stupid trollish posters on this forum, but you are a rival to the very worst of them. I can't wait to get my (third) thousand posts so I can lobby to get you banned.

harry 48

    Topic Starter


    Egghead

  • lay back , relax and chill out
  • Thanked: 129
    • Yes
    • Yes
    • Yes
    • Dribbling Pensioner
  • Certifications: List
  • Experience: Familiar
  • OS: Windows 7
Re: multiply
« Reply #42 on: August 24, 2009, 03:46:31 PM »
My guess is 9 to 11 (max). Judging by the maturity of his posts.


i agree read a few more in other posts


Like I really believe that.   ::) Student, maybe, but even that's unlikely.


salmon trout , don't be unkind to an old plumber who likes maths , and thinks he was a tutor

kpac

  • Web moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: multiply
« Reply #43 on: August 24, 2009, 03:47:24 PM »
"Third"?

Quote
so I can lobby to get you banned.
No need to worry there...

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: multiply
« Reply #44 on: August 24, 2009, 04:22:59 PM »
"Third"?


yes it would be the third time...


i just dont agree with BC_programmer for using basic or vb

And I don't agree with Smeezekitty for using C compilers from the era of 5 1/4" floppies and early Madonna singles.
I was trying to dereference Null Pointers before it was cool.

smeezekitty

  • Guest
Re: multiply
« Reply #45 on: August 24, 2009, 05:03:26 PM »
actully it was shiped on 3 1/2 inch disks
it was made in 1989
its only 20 years old

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: multiply
« Reply #46 on: August 24, 2009, 05:14:46 PM »
it's only 20 years old

only.... ONLY?

Are you not aware of how much has changed programming wise in 20 years? of course not, your still programming CGA splash screens.


Optimizing compilers, Integrated debuggers, all designed for convenience. Using some old DOS compiler doesn't make you look "macho" or old school, it just makes you look like an old geezer clinging to relics of a past life that they never had, in an effort to make yourself look competent.

It fails miserably.

How many programs can you buy, on the market- in a retail store, for example - are designed for DOS? None. I cannot think of a single DOS-based application that still sells at retail. Why? Because the companies either made to windows (Lotus 123...) or were smashed out of the market by their competitors who did.

How much is knowing how to program within DOS worth to a company that creates programs for Windows, Mac OS and/or Linux? Not much.

DOS is an interesting novelty, and knowing how to use it applies to todays command-line as well- but knowing how to work with interrupts, IRQs, and so forth are meaningless in the virtualized environment of windows. Almost everything has to be relearned and in fact putting "DOS programmer" on your resume could prevent employment as they don't feel that they want to retrain yet another DOS programmer in the ways of protected mode, Virtualized hardware, and memory access modes.
I was trying to dereference Null Pointers before it was cool.

smeezekitty

  • Guest
Re: multiply
« Reply #47 on: August 24, 2009, 05:26:07 PM »
i also use MSVC 1.5 to program windows 3.1
the best windows program i have made is a bitmap viewer

JJ 3000



    Egghead
  • Thanked: 237
  • Experience: Familiar
  • OS: Linux variant
Re: multiply
« Reply #48 on: August 24, 2009, 05:49:29 PM »

DOS is an interesting novelty, and knowing how to use it applies to todays command-line as well- but knowing how to work with interrupts, IRQs, and so forth are meaningless in the virtualized environment of windows. Almost everything has to be relearned and in fact putting "DOS programmer" on your resume could prevent employment as they don't feel that they want to retrain yet another DOS programmer in the ways of protected mode, Virtualized hardware, and memory access modes.


Not true. Many corporate environments are still using DOS based solutions- why? Because they work.

 >:D
Save a Life!
Adopt a homeless pet.
http://www.petfinder.com/

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: multiply
« Reply #49 on: August 24, 2009, 06:01:26 PM »
your point?

It's not new DOS based development, the companies are using the same DOS-based solution they always have, even though it both isn't supported AND in many cases, the software firm that created it has a windows version.

That has nothing to do with programming DOS, since the programming for said applications was done years ago- they work, and that's why the companies stick with them.
I was trying to dereference Null Pointers before it was cool.

smeezekitty

  • Guest
Re: multiply
« Reply #50 on: August 24, 2009, 06:06:57 PM »
lets count the advanadges of programming in dos shall we
o high speed screen writes directly to screen memory makes it faster then GDI
o your program alwasy has priorty and some other program cant kill it
o easyer to write text because you dont have to deal with the CreateFont() function and its infinte parameters
o you dont have to worry about letting other programs run; you can take all the processor power
o you dont have to worry about redrawing evreytime somone moves the window off screen
o you dont have to worry about the user resizeing the window

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: multiply
« Reply #51 on: August 24, 2009, 06:14:00 PM »

Quote
o high speed screen writes directly to screen memory makes it faster then GDI

but you need custom code for every adapter type and video mode. DirectX is more suited if you need speed then GDI.


Quote
o easyer to write text because you dont have to deal with the CreateFont() function and its infinte parameters
CreateFontInDirect() is what I use, along with the LOGFONT structure.

*well, actually, that's a lie, since I wrapped the various GDI functions into classes ages ago, so now I deal instead with CFont, CBrush, and CPen objects.




I was trying to dereference Null Pointers before it was cool.

smeezekitty

  • Guest
Re: multiply
« Reply #52 on: August 24, 2009, 06:15:33 PM »
*well, actually, that's a lie, since I wrapped the various GDI functions into classes ages ago, so now I deal instead with CFont, CBrush, and CPen objects.
thats a good idea
as for direct X no good because the code needs to compile on win32 and win16

Aegis



    Expert

    Thanked: 67
    • Yes
    • Yes
    • Brian's Mess Of A Web Page
  • Experience: Experienced
  • OS: Windows 10
Re: multiply
« Reply #53 on: August 24, 2009, 06:21:01 PM »
Real programmers use FORTRAN!   ;D

::: runs away :::


"For you, a thousand times over." - "The Kite Runner"

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: multiply
« Reply #54 on: August 24, 2009, 06:22:43 PM »
Real programmers use FORTRAN!   ;D

::: runs away :::

an excellent point aegis,

Aegis .EQ. cool

yay, I can write fortran!

I was trying to dereference Null Pointers before it was cool.

smeezekitty

  • Guest
Re: multiply
« Reply #55 on: August 24, 2009, 06:34:46 PM »
fortran started in 1956 is that old enough?
Code: [Select]
mov ax,4h
int 10h
xor cx,cx
PLOOP:
mov dx,100
mov ah,0ch
mov al,3
int 10h
inc cx
cmp cx,320
jl PLOOP
xor ax,ax
int 16h
mov ax,3h
int 10h
a real programmer programs in ASM