## Casting fraction number to decimal throws Arithmetic overflow error

I have a table called AssignmentMarks that stores Student’s assignment marks for different subjects. This table has a column called Marks varchar(10) which stores the marks. The marks can be like 1, 2, and also it can be +, - or -+ which represents each sign a specific marks.

Note: + is 1 mark, - is -1 and -+ is 0.5

While getting a student marks from the table I am facing the Arithmetic Overflow error which I don’t know what is the cause of this error.

The query is as follow:

SELECT SUM(    CAST(       CASE         WHEN a.Marks IS NULL OR a.Marks = '' THEN 0        WHEN a.Marks = '+' THEN 1        WHEN a.Marks = '-' THEN -1        WHEN a.Marks = '-+' THEN 0.5        ELSE a.Marks       END AS DECIMAL(5,2)    ) ) FROM AssignmentMarks AS a WHERE a.StudentID=10 AND a.SubjectID=1 

After Executing the above query I get the following error.

Msg 8115, Level 16, State 8, Line 7

Arithmetic overflow error converting varchar to data type numeric.

Any idea what is the main cause of this error?

## Computing continued fraction

I want to build this infinite continued fraction

$$F_{n}(x)= \frac{1}{1-x\frac{(n+1)^2}{4(n+1)^2-1}F_{n+1}(x)}$$

which gives for $$n=0$$

$$F_{0}(x)=\dfrac{1}{1-\dfrac{(1/3)x}{1-\dfrac{(4/15)x}{1-\dfrac{(9/35)x}{1-\ddots}}}}$$ I took inspiration from this Post (@Michael E2), the problem is that when I transform it as a list representation

{b0,{a1, b1},{a2, b2},...}  Clear[F2,iF2];  iF2[0]=0; iF2[1]={1,1}; iF2[2]={-x/3,1}; iF2[n_]:={-x(n+1)^2/(4(n+1)^2-1),1}; F2[n_]:=Table[iF2[k],{k,0,n}]; 

I can’t find all the terms, so I find for 5 terms

Block[{n=5},F2[n]] (*{0,{1,1},{-x/3,1},{-16x/63,1},{-25x/99,1},{-36x/143,1}}*) 

it lacks after {$$-x/3,1$$} the terms {$$-4x/15,1$$} and {$$-9x/35,1$$}

## Divergent Series & Continued Fraction (from Gauss’ Mathematical Diary)

Does someone have a reference or further explanation on Gauß’ entry from May 24, 1796 in his mathematical diary (Mathematisches Tagebuch, full scan available via https://gdz.sub.uni-goettingen.de/id/DE-611-HS-3382323) on page 3 regarding the divergent series $$1-2+8-64…$$ in relation to the continued fraction $$\frac{1}{1+\frac{2}{1+\frac{2}{1+\frac{8}{1+\frac{12}{1+\frac{32}{1+\frac{56}{1+128}}}}}}}$$

He states also – if I read it correctly – Transformatio seriei which could mean series transformation, but I don’t see how he transforms from the series to the continued fraction resp. which transformation or rule he applied.

The OEIS has an entry (https://oeis.org/A014236) for the sequence $$2,2,8,12,32,56,128$$, but I don’t see the connection either.

My question: Can anyone help or clarify the relationship that Gauss’ used?

Torsten Schoeneberg remarked rightfully in the original question that the term in the series are $$(-1)^n\cdot 2^{\frac{1}{2}n(n+1)}$$ and Gerald Edgar conjectures it might be related to Gauss’ Continued Fraction.

## Square root of fraction returns mathematical error

The error I get from the calculation

When I try to calculate the square root of a fraction using a calculator, I get a mathematical error. (see link to image) Why is this an apparently invalid operation?

## Why we need size of the page table should be some fraction of virtual address space

The Page Table should have all virtual page number which are in its logical address space, Why it’s the case?

1. Is it because we want to access Page Table entry fast just like an array where key is virtual page number i.e. constant time?

Or

1. Is it due to structure of the process? (I mean Our program uses whole logical space; In general at address 0 we have Code and at address Max we have stack which is variable. Which means can point to any address of logical address space)

## Algorithm for Egyptian Fraction

An Egyptian fraction was written as a sum of unit fractions, meaning the numerator is always 1; further, no two denominators can be the same. As easy way to create an Egyptian fraction is to repeatedly take the largest unit fraction that will fit, subtract to find what remains, and repeat until the remainder is a unit fraction, for example:

1. 7 divided by 15 is less than 1/2 but more than 1/3, so the first unit fraction is 1/3 and the first remainder is 2/15.

2. Then 2/15 is less than 1/7 but more than 1/8, so the second unit fraction is 1/8 and the second remainder is 1/120.

3. That’s in unit form, so we are finished: 7 ÷ 15 = 1/3 + 1/8 + 1/120

I’m trying to solve the egyptian fraction problem where I’m using the below greedy method:

def egyptianFraction(nr, dr):   print("The Egyptian Fraction " +       "Representation of {0}/{1} is".              format(nr, dr), end="\n")   # empty list ef to store  # denominator  ef = []   # while loop runs until   # fraction becomes 0 i.e,  # numerator becomes 0  while nr != 0:       # taking ceiling      x = math.ceil(dr / nr)       # storing value in ef list      ef.append(x)       # updating new nr and dr      nr = x * nr - dr      dr = dr * x   # printing the values  for i in range(len(ef)):      if i != len(ef) - 1:          print(" 1/{0} +" .                   format(ef[i]), end = " ")      else:          print(" 1/{0}" .                  format(ef[i]), end = " ")  egyptianFraction(6, 14)  

I need to build an algorithm that guarantees a maximum number of terms or a minimum largest denominator; for instance,

5 ÷ 121 = 1/25 + 1/757 + 1/763309 + 1/873960180913 +  1/1527612795642093418846225  but a simpler rendering of the same number is  1/33 + 1/121 + 1/363. 

## Is this a continued fraction? How to solve for x

I believe following is a continued fraction. I’m stumped on how to solve for x

$$x = \frac{a}{b} = \frac{b}{a/3}$$

I know it can be re-written as

$$x = \frac{a}{b} = \frac{3b}{a}$$

$$x = a^2 = 3b^2$$

I’m unsure where to go from here.

Below are the choices

$$x=9$$

$$x=\frac{1}{3}$$

$$x=3$$

$$x=\frac{1}{\sqrt3}$$

$$x={\sqrt3}$$

## I need to convert fraction to hex but there is perhaps a mask [on hold]

I get the following values from a machine. I type the hex value in and it sets the machine to a decimal with two places after the point.

Machine setting hex value
0.1 3DCCCCCD
0.11 3DE147AE
0.12 3DF5C28F
0.13 3E051EB8
0.25 3E800000
0.5 3F000000
0.75 3F400000
1 3F800000
2 40000000

I take 0.31 and I work it out to 0.4F5C28F6 but the machine says 0.31=3E9EB852 How do I get from 0.4F5C28F6 to 3E9EB852 is there some mask I need to apply?

## Excel format to improper fraction OR integer

I am currently using custom formatting to get an improper fraction (###/###), however, I will need the integers to be 7 instead of 7/1. How do I achieve both improper fraction OR integer (if it can be simplified)?

## Using Lagrange interpolation formula, deduce partial fraction

Question no 3 , kindly explain the relation btw lagrange and partial fraction](https://i.stack.imgur.com/EYVIk.jpg)

I am unable to figure out the relation btw lagrange interpolation formula and partial fractions.