# Symbolic sqrt(2) and sin(pi)

**URL:** https://discourse.julialang.org/t/symbolic-sqrt-2-and-sin-pi/58633
**Category:** Specific Domains
**Tags:** symbolic
**Created:** [April 4, 2021, 7:03pm UTC](https://discourse.julialang.org/t/symbolic-sqrt-2-and-sin-pi/58633 "2021-04-04T19:03:25Z")
**Posts on this page:** 1
**Showing post:** 21

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [April 6, 2021, 12:47am UTC](https://discourse.julialang.org/t/symbolic-sqrt-2-and-sin-pi/58633/21 "2021-04-06T00:47:46Z")

</div>

Sorry, I thought it was pretty clear but the threads are long now. We need to capture the literal `2` and make it `Literal(2)`. But then the issue is that we want `Literal{T} <: T` semantics. I.e. in `promote_type` it should use the promotions of `T` to build the value that is finally used in its rule applications or in its generated code. But not just `promote_type`, but every function. Without `Literal{T} <: T` semantics, that would require the symbolic library mimics `promote_type`, `sin`, and etc. dispatches of every number type, which then would mean we only would support `Literal{T}` for chosen types. So for now you can create the number with the type that you want, i.e. `Term(sqrt,[big(2)])` and when the whole `Sym{T} <: T` passes are working `Literal` will just be a new `istree` under the same semantics and that would do this automatically.

`Sym{T} <: T` of course has been talked about at length on these forums and elsewhere with the solution to be to build it in the tracing environment. We just need to make any type satisfying some trait be captured to automatically have these semantics.

---

_[View the full topic](https://discourse.julialang.org/t/symbolic-sqrt-2-and-sin-pi/58633)._
