#### Category : math

My python program about radical numbers that i created isnt working as i want. √72 = 6√2. But my program shows: 2√18. Lets say that a√b is a variable. I want ‘b’ to be the least value. How can i do that? My program is so big so i can’t write all of them. So ..

I am sure about that there aren’t any mistakes in my class. I can’t give all codes because the program is big. The program is about radical numbers. Such as converting √8 to 2√2. I am going to use this class in my main python file. Here are the codes: def kokluyazdir(self,number): i = 1 ..

I was bored so I wrote a modulo operator in C++. When I enter 17 and 2 (17 % 2), it returns 7 instead of 1. What did I do wrong? #include <iostream> #include "Header.h" double modulo(double number1, double number2) { int counter=0; double result1=0; double result2 = 0; while (number1 / number2 > result1) ..

to practice C++ i decided to write a modulo function. but it returns -nan(ind) how can i make it that the return is the rest of the division? #include <iostream> #include "Header.h" double modulo(double number1, double number2) { double intermediate_result_1=5; double result; int counter = 0; while (intermediate_result_1 < number1) { counter++; intermediate_result_1 = number2 ..

The Problem Statement is: You’ve to display the digits of a number. Take as input "n", the number for which digits have to be displayed. Print the digits of the number line-wise. #include<iostream> #include<cmath> using namespace std; int main(){ int n; cin>>n; int nod = 0; int temp = n; while(temp != 0){ temp = ..

I implemented a CS paper to solve for geodesics on meshes. When I disable all optimizations I get exactly what I expect. If I enable optimizations however I get either NAN’s, infinity, or any number of weird results. I have checked all the stages of the algorithm and the error seems to happen on the ..

I am currently working on a project for my Data Structures Course that involves a Binary Search Tree built using a doubly linked list-type format (where each node has a left, right, and parent pointer). The class managing the tree also has a root pointer and a current pointer (like a cursor). One of the ..