add log10() function

This commit is contained in:
Jeff Wang
2019-10-02 23:38:12 -04:00
parent 0f17fbdcc7
commit 21be4081b2
3 changed files with 20 additions and 4 deletions

View File

@ -118,12 +118,21 @@ void process_cmd(char cmd){
toggle_shifted();
} break;
//////////
case '9':{
if (IsShifted && !decn_is_nan(&stack(STACK_X))){ //log10(x)
copy_decn(&AccDecn, &stack(STACK_X));
log10_decn();
copy_decn(&stack(STACK_X), &AccDecn);
IsShifted = 0;
}
} break;
//////////
case '8':{
if (IsShifted && !decn_is_nan(&stack(STACK_X))){ //ln(x)
copy_decn(&AccDecn, &stack(STACK_X));
ln_decn();
copy_decn(&stack(STACK_X), &AccDecn);
toggle_shifted();
IsShifted = 0;
}
} break;
//////////