300 Topics

Member Avatar for
Member Avatar for Nerathas

Hello, I have this program that simplifies a fraction by calculating the greatest common divisor. So the fraction 8/4 (largest common divisor = 4) 8/4 4/4 => result would be 2/1 (fraction simplified) My problem is my method calculated this greatest common divisor. But now that value has to be …

Member Avatar for ddanbe
0
159
Member Avatar for Chargerfan

how do i retrieve complex numbers (a + jb) so that just a appears in one textbox and just b appears in another textbox?

Member Avatar for privatevoid
0
99
Member Avatar for samarudge

Hi, What is the function/opperator to calculate a power with C# I tryed [code=c] powerof = anumber ^ anothernumber; [/code] and that clearly doesn't work (1^3 is 2, 2^3 is 1 etc.) How do I do it??? I looked under [icode]Math.[/icode] functions and there was nothing and I spent ages …

Member Avatar for ddanbe
1
178
Member Avatar for ddanbe

Whenever you hear the word recursion, factorials or Towers of Hanoi are never far away. Well here they get mentioned, because we are not going to talk about these guys at all! Iteration and recursion are in fact quite similar: they both loop until a certain condition is met. As …

2
3K
Member Avatar for rzhaley

im supposed to write a code that you prompt to enter 10 different grades then drop the minimum value, while computing the average of the remaining 9. I'm getting infinity as the answer when I run the program so I know my min is messed up, somewhere but i cant …

Member Avatar for Geekitygeek
0
225
Member Avatar for Mafia619

Hey, I've got an assignment from my computer teacher in school. I've got to make a program that displays the prime numbers in a range and also display the number of prime numbers that are present. And i'm only supposed to use the basic header files.....that means the program should …

Member Avatar for VernonDozier
0
288
Member Avatar for denizen08

[CODE]#include <cmath> long double NR(long double sample) { return (abs(f(sample)))<=1e-10 ? sample: NR( (sample - f(sample)/fp(sample))); } long double f(long double sample) { return 2.5*exp(-sample)-3*sin(sample); } long double fp(long double sample) { return -2.5*exp(-sample)-3*cos(sample); }[/CODE] I'm trying to write code for a Newton-Raphson algorithm. I have it in recursive form …

Member Avatar for denizen08
0
179
Member Avatar for Kruptein

Hi I'm trying to find a way to find the first avogadro cipher whose digital sum exceeds 100, I've come to: [code=python]#!/usr/bin/python def dig_sum(n): lst = list(str(n)) ln = len(lst) sm = 0 while(i < ln): sm += int(lst[i]) return sm def avo(i,j,k,c): k = j j = i + …

Member Avatar for Kruptein
0
214
Member Avatar for fawkman

Hi guys, I am working on a conversion of the Mandelbrot Fractal from Java to C# and my programming skills are lacking quite a bit. I am desperately trying to improve but I have come across some errors that are stumping me. I have attached a txt file with the …

Member Avatar for fawkman
0
644
Member Avatar for Byrne86

Hi, Iv had to convert a program from Java to C#, I thought I had done it, but it doesnt work, and Im at a loose end because I cant figure out why it isnt working. Anyway, what it is is a Mandelbrot Set that Im trying to display in …

Member Avatar for ddanbe
0
544
Member Avatar for bcohenllc

Alright.. i figured out mostly everything but my math is still screwing me up. I need to accumulate running totals for number of checks and number of deposits ;and total value of checks and total value of deposits. Im supposed to do this by looping through my arrays and this …

0
170
Member Avatar for James19142
Member Avatar for mrnutty
-1
218
Member Avatar for ayeshawzd
Member Avatar for umair125

i want to write a function of sign function without using system.math library in c#. plz help me how can i write this code???

Member Avatar for ddanbe
0
90
Member Avatar for Daiosmith

Hello all, I'm having some trouble with a project I am doing and I was wandering if anybody could help me/point me in the right direction. So the gist of what is happening is I have a program that is supposed to be flipping 2 coins independently of each other …

Member Avatar for Rashakil Fol
0
294
Member Avatar for Geekitygeek

I'm currently re-writing a bit of code and i'm in two minds about which way to take it. Advice would be greatly appreciated :) The application is used to control a USB circuit board. The board has 32 analog outputs. The outputs are switched on and off by sending a …

Member Avatar for Geekitygeek
0
191
Member Avatar for procomp65

Hi I need to format a decimal value to time and then display it in a textbox in the proper format. eg: double value = 1.25 to "1:15" I do not have a clue how to go about it Thanks

Member Avatar for procomp65
0
3K
Member Avatar for MervinKoops

Hello, I need to create a function which takes parameters for a circle and checks if a given point(x,y) lies within the circle (or on the edge). Like this: [CODE]public static bool PointExistsInCircle(Double CircleX,Double CircleY,Double CircleRadius,Double PointX,Double PointY) { needs to return 'true' if the point is in the circle, …

Member Avatar for MervinKoops
0
182
Member Avatar for rob-lozyniak

I am aware that JavaScript arithmetic does not handle either really large numbers or decimals well. This is why I have made this library of functions. I am posting it here rather than under "code snippets" because I would like to learn from your comments. Along with the library is …

0
1K
Member Avatar for polo_coins

I want get a root of number in C# what library i must to insert and what command solve it

Member Avatar for ddanbe
0
161
Member Avatar for newsguy

When it was reported this week that [URL="http://www.itwire.com/content/view/20747/1066/"]Professor Stephen Hawking[/URL] had been taken into hospital and was "very ill" the overall mood of the media seemed to be that the Lucasian Professor of Mathematics at Cambridge University and author of the best selling 'A Brief History of Time' book was …

Member Avatar for NicAx64
0
383
Member Avatar for happygeek

Stephen Wolfram is a British physicist perhaps best known for his work in creating the computational software Mathematica. That could all soon be forgotten if his Wolfram Alpha computational data engine proves to be the Google killer that some are suggesting. After all, it claims to be able to answer …

Member Avatar for yegg
0
280
Member Avatar for happygeek

[URL="http://www.rackspace.co.uk"]Rackspace Managed Hosting[/URL] has today sent me the formula to create the perfect website, and being a nice chap I felt I had to share it with you, so here goes: [B]Pwebsite = { ((14.14* EaseNav) + (13.56*Speed) + (13.11*CleanDes) + (10.89*Func) + (10.89*Up)) – ((12.63*Pops) + (10.32*Ads) +(5.21*MultiM)) } …

Member Avatar for tleisher
1
289
Member Avatar for ddanbe

Blink and you will see them appear in a Console window. This is a translation to C# of a Modula-2 implementation by N.Wirth, the inventor of Pascal. The tested integers are obtained by incrementing alternatively by 2 and 4, thereby avoiding multiples of 2 and 3 in the first place. …

Member Avatar for ddanbe
0
94
Member Avatar for ddanbe

A bunch of basic statistical functions. I could have made a class here and I could have used more features of C#. But just to keep it simple I left it as a console application. So the modifications you have to make if you're into C, C++, Java etc. should …

1
475
Member Avatar for ddanbe

[TEX]Solve an equation of the form Ax^2 + Bx + C = 0.[/TEX] The class is commented, but if you have any questions don't be affraid to ask. You may exercise this class in a console application with the following snippet : [CODE]QuadraticEquation z = new QuadraticEquation(1, 3, 3); z.Solve(); …

0
779
Member Avatar for ddanbe

Most of the time there are many ways to implement an algorithm. Here are two ways to implement the greatest common divisor algoritm, one of the oldest algorithms ever.

0
404
Member Avatar for ddanbe

If you have to convert an angle from degrees to radians and way back, here are some utility functions in C#, along with a program to test them. I made use of the "out" keyword here, which allows a function to return more than one value. An alternative would be …

0
340
Member Avatar for laghaterohan

Hey....hello all i am writing a very simple function of calculating a square of a number entered by the user and then displaying it. While writing the function in c# i am getting n number of errors regarding conversion type....plz help me out of this .....here is the function... [code] …

Member Avatar for ddanbe
0
111
Member Avatar for afr0

Hi All, I'm trying to implement the NORMSDIST function of MS excel in the C#. I found its implementation from the following link. [url]http://office.microsoft.com/en-us/excel/HP052091941033.aspx[/url] and I've written the following code for this i.e. [code] static double NORMSDIST(double z_score) { double z_ = - ( (z_score * z_score) / 2 ); …

Member Avatar for ddanbe
0
2K

The End.