+ 2
Math calculation of percentage
how to math calculation of percentage? such as: 30 % 4 or 369% 35.
13 Respuestas
+ 2
I mean % in javascript. what does it mean in js?
+ 2
modulo operator means?explain it?
+ 2
it means division operator. right! thanks jaya and visph
+ 1
you mean in programming?
In JavaScript :
var a=30;
var b=4;
document.write(a%b) ;
Output: 2
If not, Please provide your problem description clearly..
+ 1
Math percentages and programming operator % aren't related at all...
In computer context, x % y means remainder of the integer division of x by y (named 'modulo' in both math and computer fields).
In math context, x% of y means x hundredths of y, in other words:
value = float(input())
rate = float(input())
percent = value*rate/100
print(str(rate)+'% of',value,'equals',percent)
+ 1
in js that's the modulo operator ^^
+ 1
That's already said in my first post...
+ 1
It's called modular operator.. Gives you reminder of calculation (a%b) in dividend(a) divided by divisor(b).
I included already a example in my first post, see it again..
+ 1
Shadman Sakib
Division operator is / returns quotiont.
a=30,b=4
document.write(a/b); this prints 7
Modula operator is % returns reminder.
document.write(a%b); this prints 2
A slight difference is calling in programming language.
+ 1
Iyad Ahmed that was not my question.Though thanks for your comment. ☺
0
thanks all for the help ☺
0
30% is just 30/100
use that instead when doing calculations then multiply by hundred in the end
0
Shadman Sakib
ok it seems you say an expression like 3 % 4
this means the modulo operator as other people answered
https://www.computerhope.com/jargon/m/modulo.htm