MULTIPLICATON OF A FIELD IN A FILE WITH A CONSTANT

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Post by moneo »

Z!re,

I looked up the Spanish equivalent of QUOTIENT, which is COCIENTE. They are both derived from the Latin QUOTIENS. However, in Spanish, very few people use the word. They prefer words like RESULT, ANSWER, or something similar.

Precise arithmetic terms like these are no longer being used in the common language. Who says MINUEND and SUBTRAHEND anymore, or ADDEND, or MULTIPLICAND and MULTIPLIER, or DIVIDEND and DIVISOR? Only programmers :wink: and school teachers.
*****
User avatar
Michael Calkins
Veteran
Posts: 76
Joined: Tue Apr 05, 2005 8:40 pm
Location: Floresville, Texas
Contact:

Post by Michael Calkins »

Product refers to the result of a multiplication.
I use some of those, like addend, divisor, etc. I would use them all, except I can't remember which is which. :-(
What's the difference between a MULTIPLICAND and MULTIPLIER? Multiplications is associative...
Btw, Z!re: Some people find all uppercase annoying. Other people find skipping 2 lines at a time in a post just for the fun of it annoying. Not flaming you, but just pointing out various typing styles. Tolerance is good, eh?
Regards,
Michael
Bring on the Maulotaurs! oops...
I like to slay Disciples of D'Sparil...
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

That STILL DEPEND! on the LANGUAGE!,





just LIKE! me AND! moneo ALREADY POINTED OUT!. :wink:
I have left this dump.
User avatar
SebMcClouth
Veteran
Posts: 240
Joined: Fri Apr 29, 2005 2:20 am
Location: Inside the Matrix

Post by SebMcClouth »

I'm Dutch and in Dutch we know Product also as product but indeed aslo as quotient.

grtz
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

If more people wish to throw in some already gone over points, feel free to do so..

Anyone? :roll: :wink: :lol:
I have left this dump.
moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Post by moneo »

Michael Calkins wrote:Product refers to the result of a multiplication.
I use some of those, like addend, divisor, etc. I would use them all, except I can't remember which is which. :-(
What's the difference between a MULTIPLICAND and MULTIPLIER? Multiplications is associative...
Btw, Z!re: Some people find all uppercase annoying. Other people find skipping 2 lines at a time in a post just for the fun of it annoying. Not flaming you, but just pointing out various typing styles. Tolerance is good, eh?
Regards,
Michael
Ok, Michael, I wasn't 100% sure, so I looked them up in my encyclopedia.
These are for American English.

ADDEND + ADDEND = SUM

MINUEND - SUBTRAHEND = DIFFERENCE, also REMAINDER

MULTIPLICAND * MULTIPLIER = PRODUCT

DIVIDEND / DIVISOR = QUOTIENT

Note that REMAINDER has two meanings:
(1) : the number left after a subtraction
(2) : the final undivided part after division that is less than the divisor
*****
User avatar
Michael Calkins
Veteran
Posts: 76
Joined: Tue Apr 05, 2005 8:40 pm
Location: Floresville, Texas
Contact:

Post by Michael Calkins »

Thanks, Moneo.
But it still confuses me that 2 disctinct terms are used for the opperands for multiplication. Those numbers could be reversed, and the result will always be the same, thanks to the associative property. Addition uses 1 term, the Addend, because
5 + 3 = 3 + 5
Also
5 * 3 = 3 * 5
So really, multiplicand and multiplier would be the same, because reversing them yields the same number. It is strange that they are not both called the multiplicand...
Division and subtraction, on the other hand, require distinct terms for their opperands, because they are not associative.
Regards,
Michael
Bring on the Maulotaurs! oops...
I like to slay Disciples of D'Sparil...
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

I thought it was: FACTOR * FACTOR = PRODUCT

That's how it's in sweden anyways
I have left this dump.
moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Post by moneo »

Z!re wrote:I thought it was: FACTOR * FACTOR = PRODUCT

That's how it's in sweden anyways
The only reference that I could find for the word FACTOR regarding multiplication is:
234 (multiplicand)
X 7 (multiplier)

When performing the long-hand multiplication above, each of the three digits in the multiplicand is multiplied by a FACTOR of 7.

This was from the Encyclopaedia Britannica.
*****
If you are ahead of me, lead.
If you are behind me, follow.
If you are not doing anything,
Get out of the way.
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

The words are different and are used differently in different languages. Remember that not everyone's native language is English.
User avatar
Michael Calkins
Veteran
Posts: 76
Joined: Tue Apr 05, 2005 8:40 pm
Location: Floresville, Texas
Contact:

Post by Michael Calkins »

Finally got out my math book...
Z!re is right. Both opperands are "factors". This is logical because multiplication is associative. 2 distinct words would be illogical and unjustifiable. I should have remembered this, but I didn't. I'm not sure that I have heard the other words before now. Are those other 2 new phrases?

English is the language of the computer world.
Z!re wrote:
I thought it was: FACTOR * FACTOR = PRODUCT

That's how it's in sweden anyways
That is how it is in the United States as well. I wish I would have remembered that...
Regards,
Michael
Bring on the Maulotaurs! oops...
I like to slay Disciples of D'Sparil...
User avatar
SebMcClouth
Veteran
Posts: 240
Joined: Fri Apr 29, 2005 2:20 am
Location: Inside the Matrix

Post by SebMcClouth »

Well here in Holland we also use factor * factor = product...

:? Let's make an international quickbasic/freebasic English... based upon Svenska...

grtz
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Post by moneo »

Michael Calkins wrote:..... I'm not sure that I have heard the other words before now. Are those other 2 new phrases?.....
No, the 2 words, MULTIPLICAND and MULTIPLIER, are certainly not new. Look them up in any English dictionary.

BTW, in ADDITION, although it is associative, the word ADDEND is used for the 2 or more values to be added. If you were to add 3 values, each of them is called an ADDEND.
*****
If you are ahead of me, lead.
If you are behind me, follow.
If you are not doing anything,
Get out of the way.
User avatar
Michael Calkins
Veteran
Posts: 76
Joined: Tue Apr 05, 2005 8:40 pm
Location: Floresville, Texas
Contact:

Post by Michael Calkins »

You're right. Thanks.
Bring on the Maulotaurs! oops...
I like to slay Disciples of D'Sparil...
moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Post by moneo »

Michael Calkins wrote:You're right. Thanks.
You're welcome, Michael.
*****
Quibbler

Formatting

Post by Quibbler »

I just thought I would answer the question rather than quibbling about CAPS lock. If you want a certain number of dps try
PRINT USING "#.##";number
moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Re: Formatting

Post by moneo »

Quibbler wrote:I just thought I would answer the question rather than quibbling about CAPS lock. If you want a certain number of dps try
PRINT USING "#.##";number
PRINT USING was already mentioned in a previous post of mine.

However, since you bring it up again, one should be aware that PRINT USING will perform Symmetric Arithmetic Rounding when applicable, which is perhaps the most common method of rounding. Example:
number# = 123.456
print using "###.##";number#
...will print 123.46

number# = -123.456
print using "###.##-";number#
...will print 123.46-

If this is not the type of rounding that you want, or if you want truncation, then you have to apply your own rounding method or truncation on the number before doing the PRINT USING.

How rounding or truncation is done is important in certain applications. Don't just do the PRINT USING and hope for the best.
*****
If you are ahead of me, lead.
If you are behind me, follow.
If you are not doing anything,
Get out of the way.
Quibbler

Post by Quibbler »

Ok I eventually found your reference to print using
6) You can use PRINT #n USING to control how many maximum decimal places you need in your result to the output file. If for some reason you're not gonna use the PRINT USING, then you will need some extra code to normalize the result before writing it to the output file. Tell us what you're going to do.
I cannot see the problems you seem to see in format statements, the rounding is just what most people are looking for. I don't understand the example with the trailing minus either.

x=-123.4567:y=456.789
print using "####.## ####.##";x;y
-123.46 456.79
moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Post by moneo »

Quibbler wrote:Ok I eventually found your reference to print using
6) You can use PRINT #n USING to control how many maximum decimal places you need in your result to the output file. If for some reason you're not gonna use the PRINT USING, then you will need some extra code to normalize the result before writing it to the output file. Tell us what you're going to do.
I cannot see the problems you seem to see in format statements, the rounding is just what most people are looking for. I don't understand the example with the trailing minus either.

x=-123.4567:y=456.789
print using "####.## ####.##";x;y
-123.46 456.79
I don't know what you mean by "format statements". I did not use this terminology.

In your example, the mask of "####.##" tends to imply that it can handle up to 4 significant digits.
1) If you give it a positive value with up to 4 significant digits, it works.
2) If you give it a negative value with up to 3 significant digits, it also works, with a leading minus sign taking the place of the high-order digit of the 4 significant digits.
3) However, if you give it a negative value with 4 significant digits, the result will contain a leading % to indicate an error, because it has no place to put the leading minus sign.

Because of this, we always used the mask with the trailing minus sign, like "####.##-" or "#,###.##-" to allow the correct number of leading digits, regardless of the sign, and a trailing minus sign for negative values.

I hope this now makes sense to you.
*****
Post Reply