diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp
index 3b5f3ab9e2870c2107898666df7d167550a2fa17..e25cedaeb4fc093be7c0978a03bdc3c14618e810 100644
--- a/indra/llappearance/llpolymorph.cpp
+++ b/indra/llappearance/llpolymorph.cpp
@@ -557,11 +557,11 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
 	// Check for NaN condition (NaN is detected if a variable doesn't equal itself.
 	if (mCurWeight != mCurWeight)
 	{
-		mCurWeight = 0.0;
+		mCurWeight = 0.0f;
 	}
 	if (mLastWeight != mLastWeight)
 	{
-		mLastWeight = mCurWeight+.001;
+		mLastWeight = mCurWeight + 0.001f;
 	}
 
 	// perform differential update of morph
diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp
index aeef78fc4c9db9733a470412cf9857b488d9b705..4198494a14f49a2dc791de4fee5ce53bc898ad2c 100644
--- a/indra/llaudio/llaudioengine.cpp
+++ b/indra/llaudio/llaudioengine.cpp
@@ -756,15 +756,13 @@ void LLAudioEngine::setMaxWindGain(F32 gain)
 
 F64 LLAudioEngine::mapWindVecToGain(const LLVector3& wind_vec)
 {
-	F64 gain = 0.0;
-	
-	gain = wind_vec.magVec();
+	F64 gain = static_cast<F64>(wind_vec.magVec());
 
 	if (gain)
 	{
-		if (gain > 20)
+		if (gain > 20.0)
 		{
-			gain = 20;
+			gain = 20.0;
 		}
 		gain = gain/20.0;
 	}
@@ -784,14 +782,14 @@ F64 LLAudioEngine::mapWindVecToPitch(const LLVector3& wind_vec)
 	listen_right.setVec(1.0,0.0,0.0);
 
 	// measure angle between wind vec and listener right axis (on 0,PI)
-	theta = acos(norm_wind * listen_right);
+	theta = (F64)acos(norm_wind * listen_right);
 
 	// put it on 0, 1
-	theta /= F_PI;					
+	theta /= D_PI;					
 
 	// put it on [0, 0.5, 0]
 	if (theta > 0.5) theta = 1.0-theta;
-	if (theta < 0) theta = 0;
+	if (theta < 0.0) theta = 0.0;
 
 	return (theta);
 }
@@ -809,10 +807,10 @@ F64 LLAudioEngine::mapWindVecToPan(const LLVector3& wind_vec)
 	norm_wind.normVec();
 
 	// measure angle between wind vec and listener right axis (on 0,PI)
-	theta = acos(norm_wind * listen_right);
+	theta = (F64)acos(norm_wind * listen_right);
 
 	// put it on 0, 1
-	theta /= F_PI;					
+	theta /= D_PI;					
 
 	return (theta);
 }
diff --git a/indra/llaudio/llwindgen.h b/indra/llaudio/llwindgen.h
index ec58f76f5fd34c48d824e3cbabac3e794fceb33d..e60e1c8ee3ff685b69e5692e521d875ddbabd355 100644
--- a/indra/llaudio/llwindgen.h
+++ b/indra/llaudio/llwindgen.h
@@ -74,7 +74,7 @@ public:
 		bool interp_freq = false; 
 		
 		//if the frequency isn't changing much, we don't need to interpolate in the inner loop
-		if (llabs(mTargetFreq - mCurrentFreq) < (mCurrentFreq * 0.112))
+		if (llabs(mTargetFreq - mCurrentFreq) < (mCurrentFreq * 0.112f))
 		{
 			// calculate resonant filter coefficients
 			mCurrentFreq = mTargetFreq;
diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp
index 331ba46cab5d1819112bf57f6811b141313d9b63..902adb4b11742f8fc780273b33d81eb767a212cb 100644
--- a/indra/llcharacter/llbvhloader.cpp
+++ b/indra/llcharacter/llbvhloader.cpp
@@ -1099,7 +1099,7 @@ void LLBVHLoader::optimize()
 
 			F32 rot_threshold = ROTATION_KEYFRAME_THRESHOLD / llmax((F32)joint->mChildTreeMaxDepth * 0.33f, 1.f);
 
-			double diff_max = 0;
+			F32 diff_max = 0.f;
 			KeyVector::iterator ki_max = ki;
 			for (; ki != joint->mKeys.end(); ++ki)
 			{
@@ -1189,14 +1189,14 @@ void LLBVHLoader::optimize()
 						// had the largest deviation from the earlier tests).  Note that a more robust approach would be test all intermediate
 						// keyframes against the line between the last good keyframe and current, but we're settling for this other method
 						// because it's significantly faster.
-						if (diff_max > 0)
+						if (diff_max > 0.f)
 						{
 							if (ki_max->mIgnoreRot == TRUE)
 							{
 								ki_max->mIgnoreRot = FALSE;
 								joint->mNumRotKeys++;
 							}
-							diff_max = 0;
+							diff_max = 0.f;
 						}
 					}
 					else
diff --git a/indra/llcharacter/lljointsolverrp3.cpp b/indra/llcharacter/lljointsolverrp3.cpp
index 251c556fb87762a62dae6443e846407d2ef189c1..6c1031b247503fe2a61d1b8baa4f49a745843d12 100644
--- a/indra/llcharacter/lljointsolverrp3.cpp
+++ b/indra/llcharacter/lljointsolverrp3.cpp
@@ -268,7 +268,7 @@ void LLJointSolverRP3::solve()
 							<< "theta        : " << theta << LL_NEWLINE
 							<< "bRot         : " << bRot << LL_NEWLINE
 							<< "theta abbcAng theta-abbcAng: " 
-								<< theta*180.0/F_PI << " " 
+								<< theta*180.f/F_PI << " " 
 								<< abbcAng*180.0f/F_PI << " " 
 								<< (theta - abbcAng)*180.0f/F_PI 
 	<< LL_ENDL;
@@ -353,7 +353,7 @@ void LLJointSolverRP3::solve()
 	LL_DEBUGS("JointSolver") << "abcNorm = " << abcNorm << LL_NEWLINE
 							<< "apgNorm = " << apgNorm << LL_NEWLINE
 							<< "pRot = " << pRot << LL_NEWLINE
-							<< "twist    : " << mTwist*180.0/F_PI << LL_NEWLINE
+							<< "twist    : " << mTwist*180.f/F_PI << LL_NEWLINE
 							<< "twistRot : " << twistRot << LL_ENDL;
 
 	//-------------------------------------------------------------------------
diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp
index b35a5a6080961f612a686788accdd32df8908441..5799306f5d596b92ff30f76e15fea59a3b2654fc 100644
--- a/indra/llcommon/llfasttimer.cpp
+++ b/indra/llcommon/llfasttimer.cpp
@@ -405,7 +405,7 @@ void BlockTimer::dumpCurTimes()
 		U32 num_calls = last_frame_recording.getSum(timerp->callCount());
 
 		// Don't bother with really brief times, keep output concise
-		if (total_time < F32Milliseconds(0.1f)) continue;
+		if (total_time < F64Milliseconds(0.1)) continue;
 
 		std::ostringstream out_str;
 		BlockTimerStatHandle* parent_timerp = timerp;
diff --git a/indra/llcommon/llframetimer.cpp b/indra/llcommon/llframetimer.cpp
index 1ecc1b24c6f116d8f216859b659feaab0bc31954..5116cf66610f106f99ca0e0ed80aaec02bf33777 100644
--- a/indra/llcommon/llframetimer.cpp
+++ b/indra/llcommon/llframetimer.cpp
@@ -94,7 +94,7 @@ void LLFrameTimer::unpause()
 
 void LLFrameTimer::setTimerExpirySec(F32 expiration)
 {
-	mExpiry = expiration + mStartTime;
+	mExpiry = static_cast<F64>(expiration) + mStartTime;
 }
 
 void LLFrameTimer::setExpiryAt(F64 seconds_since_epoch)
diff --git a/indra/llcommon/llframetimer.h b/indra/llcommon/llframetimer.h
index 001268a5137b823b6423b10d6ea75168c48251b1..ac06bbd128c75c54d64d987a12348ff9a2592c36 100644
--- a/indra/llcommon/llframetimer.h
+++ b/indra/llcommon/llframetimer.h
@@ -86,6 +86,7 @@ public:
 	void setExpiryAt(F64 seconds_since_epoch);
 	BOOL checkExpirationAndReset(F32 expiration);
 	F32 getElapsedTimeAndResetF32() 				{ F32 t = F32(sFrameTime - mStartTime); reset(); return t; }
+	F64 getElapsedTimeAndResetF64() 				{ F64 t = F64(sFrameTime - mStartTime); reset(); return t; }
 
 	void setAge(const F64 age)						{ mStartTime = sFrameTime - age; }
 
diff --git a/indra/llcommon/llmetrics.cpp b/indra/llcommon/llmetrics.cpp
index 4e67f055d8550286d3a7b67eab2eedd40cf50992..797180f3538c86529d676426549665390b53f44e 100644
--- a/indra/llcommon/llmetrics.cpp
+++ b/indra/llcommon/llmetrics.cpp
@@ -90,7 +90,7 @@ void LLMetricsImpl::recordEvent(const std::string& location, const std::string&
 //		  {'location':'location_2', 'mesg':'mesg_3', 'success':i10, 'fail':i0} ] }
 void LLMetricsImpl::printTotals(LLSD metadata)
 {
-	F32 elapsed_time = mLastPrintTimer.getElapsedTimeAndResetF32();
+	F64 elapsed_time = mLastPrintTimer.getElapsedTimeAndResetF64();
 	metadata["elapsed_time"] = elapsed_time;
 
 	LLSD out_sd = LLSD::emptyMap();
diff --git a/indra/llcommon/llstatsaccumulator.h b/indra/llcommon/llstatsaccumulator.h
index a893cc301df156f7dbd0c30d49156569266363bc..029edaaf9ae4f737290e3dc9f33736b7888382bd 100644
--- a/indra/llcommon/llstatsaccumulator.h
+++ b/indra/llcommon/llstatsaccumulator.h
@@ -100,11 +100,11 @@ public:
     inline LLSD asLLSD() const
     {
         LLSD data;
-        data["mean"] = getMean();
-        data["std_dev"] = getStdDev();
+        data["mean"] = static_cast<LLSD::Real>(getMean());
+        data["std_dev"] = static_cast<LLSD::Real>(getStdDev());
         data["count"] = (S32)mCount;
-        data["min"] = getMinValue();
-        data["max"] = getMaxValue();
+        data["min"] = static_cast<LLSD::Real>(getMinValue());
+        data["max"] = static_cast<LLSD::Real>(getMaxValue());
         return data;
     }
 
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index ca2cf13af78de34d8de674c93d04c73258ddfdff..b5166a7719fa16782971dc0172f759f3af35ec93 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -1070,7 +1070,7 @@ public:
         // Both MEM_INFO_WINDOW and MEM_INFO_THROTTLE are in seconds. We need
         // the number of integer MEM_INFO_THROTTLE sample slots that will fit
         // in MEM_INFO_WINDOW. Round up.
-        mSamples(int((MEM_INFO_WINDOW / MEM_INFO_THROTTLE) + 0.7)),
+        mSamples(int((MEM_INFO_WINDOW / MEM_INFO_THROTTLE) + 0.7f)),
         // Initializing to F32_MAX means that the first real frame will become
         // the slowest ever, which sounds like a good idea.
         mSlowest(F32_MAX)
diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp
index 96eafb86c7704f7af85ca749c8a845c707091084..3c81e2dc31a72bdeb03b72ec4c2151ad3fe6aca1 100644
--- a/indra/llcommon/lltimer.cpp
+++ b/indra/llcommon/lltimer.cpp
@@ -381,7 +381,7 @@ F32SecondsImplicit LLTimer::getElapsedTimeAndResetF32()
 void  LLTimer::setTimerExpirySec(F32SecondsImplicit expiration)
 {
 	mExpirationTicks = get_clock_count()
-		+ (U64)((F32)(expiration * get_timer_info().mClockFrequency.value()));
+		+ (U64)((F32)(expiration * static_cast<F32>(get_timer_info().mClockFrequency.value())));
 }
 
 F32SecondsImplicit LLTimer::getRemainingTimeF32() const
@@ -391,7 +391,7 @@ F32SecondsImplicit LLTimer::getRemainingTimeF32() const
 	{
 		return 0.0f;
 	}
-	return F32((mExpirationTicks - cur_ticks) * get_timer_info().mClockFrequencyInv);
+	return F32((mExpirationTicks - cur_ticks) * static_cast<F32>(get_timer_info().mClockFrequencyInv));
 }
 
 
@@ -404,7 +404,7 @@ BOOL  LLTimer::checkExpirationAndReset(F32 expiration)
 	}
 
 	mExpirationTicks = cur_ticks
-		+ (U64)((F32)(expiration * get_timer_info().mClockFrequency));
+		+ (U64)((F32)(expiration * static_cast<F32>(get_timer_info().mClockFrequency)));
 	return TRUE;
 }
 
diff --git a/indra/llcommon/lltraceaccumulators.cpp b/indra/llcommon/lltraceaccumulators.cpp
index 6e610ac9198d154085b3533411529d1d87bc34da..e2714d57946959e9999500d963251486bd1e665f 100644
--- a/indra/llcommon/lltraceaccumulators.cpp
+++ b/indra/llcommon/lltraceaccumulators.cpp
@@ -291,8 +291,8 @@ void EventAccumulator::reset( const EventAccumulator* other )
 {
 	mNumSamples = 0;
 	mSum = 0;
-	mMin = std::numeric_limits<float>::quiet_NaN();
-	mMax = std::numeric_limits<float>::quiet_NaN();
+	mMin = std::numeric_limits<double>::quiet_NaN();
+	mMax = std::numeric_limits<double>::quiet_NaN();
 	mMean = std::numeric_limits<double>::quiet_NaN();
 	mSumOfSquares = 0;
 	mLastValue = other ? other->mLastValue : NaN;
diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h
index 32f3c99a550bcb38fcca1913d7606396813bca22..74fa22669db86c6232e9abd1a1c897a8f828fe01 100644
--- a/indra/llcommon/lltraceaccumulators.h
+++ b/indra/llcommon/lltraceaccumulators.h
@@ -284,7 +284,7 @@ namespace LLTrace
 		F64	getMax() const               { return mMax; }
 		F64	getLastValue() const         { return mLastValue; }
 		F64	getMean() const              { return mMean; }
-		F64 getStandardDeviation() const { return sqrtf(mSumOfSquares / mNumSamples); }
+		F64 getStandardDeviation() const { return sqrt(mSumOfSquares / mNumSamples); }
 		F64 getSumOfSquares() const		 { return mSumOfSquares; }
 		S32 getSampleCount() const       { return mNumSamples; }
 		bool hasValue() const			 { return mNumSamples > 0; }
@@ -373,7 +373,7 @@ namespace LLTrace
 		F64	getMax() const               { return mMax; }
 		F64	getLastValue() const         { return mLastValue; }
 		F64	getMean() const              { return mMean; }
-		F64 getStandardDeviation() const { return sqrtf(mSumOfSquares / mTotalSamplingTime); }
+		F64 getStandardDeviation() const { return sqrt(mSumOfSquares / mTotalSamplingTime); }
 		F64 getSumOfSquares() const		 { return mSumOfSquares; }
 		F64SecondsImplicit getSamplingTime() const { return mTotalSamplingTime; }
 		S32 getSampleCount() const       { return mNumSamples; }
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp
index dcff22e3da43ef2d4953bae9b533cb3fc342dafe..760c5d609190aa28e617e1bb94406b92f69d9fac 100644
--- a/indra/llcommon/lltracerecording.cpp
+++ b/indra/llcommon/lltracerecording.cpp
@@ -230,7 +230,7 @@ F32 Recording::getPerSec(const StatType<TimeBlockAccumulator::CallCountFacet>& s
 	update();
 	const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()];
 	const TimeBlockAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mStackTimers[stat.getIndex()] : NULL;
-	return (F32)(accumulator.mCalls + (active_accumulator ? active_accumulator->mCalls : 0)) / mElapsedSeconds.value();
+	return (F32)((F64)(accumulator.mCalls + (active_accumulator ? active_accumulator->mCalls : 0)) / mElapsedSeconds.value());
 }
 
 bool Recording::hasValue(const StatType<MemAccumulator>& stat)
@@ -246,7 +246,7 @@ F64Kilobytes Recording::getMin(const StatType<MemAccumulator>& stat)
 	update();
 	const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
 	const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
-	return F64Bytes(llmin(accumulator.mSize.getMin(), (active_accumulator && active_accumulator->mSize.hasValue() ? active_accumulator->mSize.getMin() : F32_MAX)));
+	return F64Bytes(llmin(accumulator.mSize.getMin(), (active_accumulator && active_accumulator->mSize.hasValue() ? active_accumulator->mSize.getMin() : F64_MAX)));
 }
 
 F64Kilobytes Recording::getMean(const StatType<MemAccumulator>& stat)
@@ -263,7 +263,7 @@ F64Kilobytes Recording::getMean(const StatType<MemAccumulator>& stat)
         {
             t = (F32) active_accumulator->mSize.getSampleCount() / (F32) div;
         }
-		return F64Bytes(lerp(accumulator.mSize.getMean(), active_accumulator->mSize.getMean(), t));
+		return F64Bytes(lerp(accumulator.mSize.getMean(), active_accumulator->mSize.getMean(), (F64)t));
 	}
 	else
 	{
@@ -276,7 +276,7 @@ F64Kilobytes Recording::getMax(const StatType<MemAccumulator>& stat)
 	update();
 	const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
 	const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
-	return F64Bytes(llmax(accumulator.mSize.getMax(), active_accumulator && active_accumulator->mSize.hasValue() ? active_accumulator->mSize.getMax() : F32_MIN));
+	return F64Bytes(llmax(accumulator.mSize.getMax(), active_accumulator && active_accumulator->mSize.hasValue() ? active_accumulator->mSize.getMax() : F64_MIN));
 }
 
 F64Kilobytes Recording::getStandardDeviation(const StatType<MemAccumulator>& stat)
@@ -287,7 +287,7 @@ F64Kilobytes Recording::getStandardDeviation(const StatType<MemAccumulator>& sta
 	if (active_accumulator && active_accumulator->hasValue())
 	{
 		F64 sum_of_squares = SampleAccumulator::mergeSumsOfSquares(accumulator.mSize, active_accumulator->mSize);
-		return F64Bytes(sqrtf(sum_of_squares / (accumulator.mSize.getSamplingTime().value() + active_accumulator->mSize.getSamplingTime().value())));
+		return F64Bytes(sqrt(sum_of_squares / (accumulator.mSize.getSamplingTime().value() + active_accumulator->mSize.getSamplingTime().value())));
 	}
 	else
 	{
@@ -414,7 +414,7 @@ F64 Recording::getMin( const StatType<SampleAccumulator>& stat )
 	update();
 	const SampleAccumulator& accumulator = mBuffers->mSamples[stat.getIndex()];
 	const SampleAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mSamples[stat.getIndex()] : NULL;
-	return llmin(accumulator.getMin(), active_accumulator && active_accumulator->hasValue() ? active_accumulator->getMin() : F32_MAX);
+	return llmin(accumulator.getMin(), active_accumulator && active_accumulator->hasValue() ? active_accumulator->getMin() : F64_MAX);
 }
 
 F64 Recording::getMax( const StatType<SampleAccumulator>& stat )
@@ -422,7 +422,7 @@ F64 Recording::getMax( const StatType<SampleAccumulator>& stat )
 	update();
 	const SampleAccumulator& accumulator = mBuffers->mSamples[stat.getIndex()];
 	const SampleAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mSamples[stat.getIndex()] : NULL;
-	return llmax(accumulator.getMax(), active_accumulator && active_accumulator->hasValue() ? active_accumulator->getMax() : F32_MIN);
+	return llmax(accumulator.getMax(), active_accumulator && active_accumulator->hasValue() ? active_accumulator->getMax() : F64_MIN);
 }
 
 F64 Recording::getMean( const StatType<SampleAccumulator>& stat )
@@ -438,7 +438,7 @@ F64 Recording::getMean( const StatType<SampleAccumulator>& stat )
         {
             t = (F32) active_accumulator->getSampleCount() / (F32) div;
         }
-		return lerp(accumulator.getMean(), active_accumulator->getMean(), t);
+		return lerp(accumulator.getMean(), active_accumulator->getMean(), (F64)t);
 	}
 	else
 	{
@@ -455,7 +455,7 @@ F64 Recording::getStandardDeviation( const StatType<SampleAccumulator>& stat )
 	if (active_accumulator && active_accumulator->hasValue())
 	{
 		F64 sum_of_squares = SampleAccumulator::mergeSumsOfSquares(accumulator, *active_accumulator);
-		return sqrtf(sum_of_squares / (accumulator.getSamplingTime() + active_accumulator->getSamplingTime()));
+		return sqrt(sum_of_squares / (accumulator.getSamplingTime() + active_accumulator->getSamplingTime()));
 	}
 	else
 	{
@@ -500,7 +500,7 @@ F64 Recording::getMin( const StatType<EventAccumulator>& stat )
 	update();
 	const EventAccumulator& accumulator = mBuffers->mEvents[stat.getIndex()];
 	const EventAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mEvents[stat.getIndex()] : NULL;
-	return llmin(accumulator.getMin(), active_accumulator && active_accumulator->hasValue() ? active_accumulator->getMin() : F32_MAX);
+	return llmin(accumulator.getMin(), active_accumulator && active_accumulator->hasValue() ? active_accumulator->getMin() : F64_MAX);
 }
 
 F64 Recording::getMax( const StatType<EventAccumulator>& stat )
@@ -508,7 +508,7 @@ F64 Recording::getMax( const StatType<EventAccumulator>& stat )
 	update();
 	const EventAccumulator& accumulator = mBuffers->mEvents[stat.getIndex()];
 	const EventAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mEvents[stat.getIndex()] : NULL;
-	return llmax(accumulator.getMax(), active_accumulator && active_accumulator->hasValue() ? active_accumulator->getMax() : F32_MIN);
+	return llmax(accumulator.getMax(), active_accumulator && active_accumulator->hasValue() ? active_accumulator->getMax() : F64_MIN);
 }
 
 F64 Recording::getMean( const StatType<EventAccumulator>& stat )
@@ -524,7 +524,7 @@ F64 Recording::getMean( const StatType<EventAccumulator>& stat )
         {
             t = (F32) active_accumulator->getSampleCount() / (F32) div;
         }
-		return lerp(accumulator.getMean(), active_accumulator->getMean(), t);
+		return lerp(accumulator.getMean(), active_accumulator->getMean(), (F64)t);
 	}
 	else
 	{
@@ -541,7 +541,7 @@ F64 Recording::getStandardDeviation( const StatType<EventAccumulator>& stat )
 	if (active_accumulator && active_accumulator->hasValue())
 	{
 		F64 sum_of_squares = EventAccumulator::mergeSumsOfSquares(accumulator, *active_accumulator);
-		return sqrtf(sum_of_squares / (accumulator.getSampleCount() + active_accumulator->getSampleCount()));
+		return sqrt(sum_of_squares / (accumulator.getSampleCount() + active_accumulator->getSampleCount()));
 	}
 	else
 	{
diff --git a/indra/llcorehttp/httpstats.cpp b/indra/llcorehttp/httpstats.cpp
index 2990b8303ab2e2de8999bab2951b13868db77d10..c633caf1183b635ce46e829c9703b6dc50c2b9ee 100644
--- a/indra/llcorehttp/httpstats.cpp
+++ b/indra/llcorehttp/httpstats.cpp
@@ -70,9 +70,9 @@ namespace
         F32 value = bytes;
         int suffix = 0;
 
-        while ((value > 1024.0) && (suffix < 3))
+        while ((value > 1024.f) && (suffix < 3))
         {
-            value /= 1024.0;
+            value /= 1024.f;
             ++suffix;
         }
 
diff --git a/indra/llimage/llimagefilter.cpp b/indra/llimage/llimagefilter.cpp
index ceef09c8e9e5bcd47ff66e1fb453b8eb8364a247..54a5fa4c59fc9f18083e669195aee4cb85b1b46d 100644
--- a/indra/llimage/llimagefilter.cpp
+++ b/indra/llimage/llimagefilter.cpp
@@ -277,7 +277,7 @@ void LLImageFilter::executeFilter(LLPointer<LLImageRaw> raw_image)
 
 void LLImageFilter::blendStencil(F32 alpha, U8* pixel, U8 red, U8 green, U8 blue)
 {
-    F32 inv_alpha = 1.0 - alpha;
+    F32 inv_alpha = 1.0f - alpha;
     switch (mStencilBlendMode)
     {
         case STENCIL_BLEND_MODE_BLEND:
@@ -364,7 +364,7 @@ void LLImageFilter::convolve(const LLMatrix3 &kernel, bool normalize, bool abs_v
     {
         for (S32 j = 0; j < NUM_VALUES_IN_MAT3; j++)
         {
-            if (i[j] >= 0.0)
+            if (i[j] >= 0.0f)
                 kernel_max += i[j];
             else
                 kernel_min += i[j];
@@ -497,7 +497,7 @@ void LLImageFilter::filterScreen(EScreenMode mode, const F32 wave_length, const
 	S32 width  = mImage->getWidth();
     S32 height = mImage->getHeight();
     
-    F32 wave_length_pixels = wave_length * (F32)(height) / 2.0;
+    F32 wave_length_pixels = wave_length * (F32)(height) / 2.0f;
     F32 sin = sinf(angle*DEG_TO_RAD);
     F32 cos = cosf(angle*DEG_TO_RAD);
 
@@ -505,8 +505,8 @@ void LLImageFilter::filterScreen(EScreenMode mode, const F32 wave_length, const
     U8 gamma[256];
     for (S32 i = 0; i < 256; i++)
     {
-        F32 gamma_i = llclampf((float)(powf((float)(i)/255.0,1.0/4.0)));
-        gamma[i] = (U8)(255.0 * gamma_i);
+        F32 gamma_i = llclampf((float)(powf((float)(i)/255.0f,1.0f/4.0f)));
+        gamma[i] = (U8)(255.0f * gamma_i);
     }
     
 	U8* dst_data = mImage->getData();
@@ -523,11 +523,11 @@ void LLImageFilter::filterScreen(EScreenMode mode, const F32 wave_length, const
                 case SCREEN_MODE_2DSINE:
                     di =  cos*i + sin*j;
                     dj = -sin*i + cos*j;
-                    value = (sinf(2*F_PI*di/wave_length_pixels)*sinf(2*F_PI*dj/wave_length_pixels)+1.0)*255.0/2.0;
+                    value = (sinf(2.f*F_PI*di/wave_length_pixels)*sinf(2.f*F_PI*dj/wave_length_pixels)+1.0f)*255.0f/2.0f;
                     break;
                 case SCREEN_MODE_LINE:
                     dj = sin*i - cos*j;
-                    value = (sinf(2*F_PI*dj/wave_length_pixels)+1.0)*255.0/2.0;
+                    value = (sinf(2.f*F_PI*dj/wave_length_pixels)+1.0f)*255.0f/2.0f;
                     break;
             }
             U8 dst_value = (dst_data[VRED] >= (U8)(value) ? gamma[dst_data[VRED] - (U8)(value)] : 0);
@@ -554,16 +554,16 @@ void LLImageFilter::setStencil(EStencilShape shape, EStencilBlendMode mode, F32
     mStencilCenterX = (S32)(mImage->getWidth()  + params[0] * (F32)(mImage->getHeight()))/2;
     mStencilCenterY = (S32)(mImage->getHeight() + params[1] * (F32)(mImage->getHeight()))/2;
     mStencilWidth = (S32)(params[2] * (F32)(mImage->getHeight()))/2;
-    mStencilGamma = (params[3] <= 0.0 ? 1.0 : params[3]);
+    mStencilGamma = (params[3] <= 0.0f ? 1.0f : params[3]);
 
-    mStencilWavelength = (params[0] <= 0.0 ? 10.0 : params[0] * (F32)(mImage->getHeight()) / 2.0);
+    mStencilWavelength = (params[0] <= 0.0f ? 10.0f : params[0] * (F32)(mImage->getHeight()) / 2.0f);
     mStencilSine   = sinf(params[1]*DEG_TO_RAD);
     mStencilCosine = cosf(params[1]*DEG_TO_RAD);
 
-    mStencilStartX = ((F32)(mImage->getWidth())  + params[0] * (F32)(mImage->getHeight()))/2.0;
-    mStencilStartY = ((F32)(mImage->getHeight()) + params[1] * (F32)(mImage->getHeight()))/2.0;
-    F32 end_x      = ((F32)(mImage->getWidth())  + params[2] * (F32)(mImage->getHeight()))/2.0;
-    F32 end_y      = ((F32)(mImage->getHeight()) + params[3] * (F32)(mImage->getHeight()))/2.0;
+    mStencilStartX = ((F32)(mImage->getWidth())  + params[0] * (F32)(mImage->getHeight()))/2.0f;
+    mStencilStartY = ((F32)(mImage->getHeight()) + params[1] * (F32)(mImage->getHeight()))/2.0f;
+    F32 end_x      = ((F32)(mImage->getWidth())  + params[2] * (F32)(mImage->getHeight()))/2.0f;
+    F32 end_y      = ((F32)(mImage->getHeight()) + params[3] * (F32)(mImage->getHeight()))/2.0f;
     mStencilGradX  = end_x - mStencilStartX;
     mStencilGradY  = end_y - mStencilStartY;
     mStencilGradN  = mStencilGradX*mStencilGradX + mStencilGradY*mStencilGradY;
@@ -583,7 +583,7 @@ F32 LLImageFilter::getStencilAlpha(S32 i, S32 j)
     {
         // alpha varies according to a squared sine function.
         F32 d = mStencilSine*i - mStencilCosine*j;
-        alpha = (sinf(2*F_PI*d/mStencilWavelength) > 0.0 ? 1.0 : 0.0);
+        alpha = (sinf(2*F_PI*d/mStencilWavelength) > 0.0f ? 1.0f : 0.0f);
     }
     else if (mStencilShape == STENCIL_SHAPE_GRADIENT)
     {
@@ -754,11 +754,11 @@ void LLImageFilter::filterGamma(F32 gamma, const LLColor3& alpha)
     
     for (S32 i = 0; i < 256; i++)
     {
-        F32 gamma_i = llclampf((float)(powf((float)(i)/255.0,1.0/gamma)));
+        F32 gamma_i = llclampf((float)(powf((float)(i)/255.0f,1.0f/gamma)));
         // Blend in with alpha values
-        gamma_red_lut[i]   = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * 255.0 * gamma_i);
-        gamma_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * 255.0 * gamma_i);
-        gamma_blue_lut[i]  = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * 255.0 * gamma_i);
+        gamma_red_lut[i]   = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * 255.0f * gamma_i);
+        gamma_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * 255.0f * gamma_i);
+        gamma_blue_lut[i]  = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * 255.0f * gamma_i);
     }
     
     colorCorrect(gamma_red_lut,gamma_green_lut,gamma_blue_lut);
@@ -781,7 +781,7 @@ void LLImageFilter::filterLinearize(F32 tail, const LLColor3& alpha)
     tail = llclampf(tail);
     U32 total = cumulated_histo[255];
     U32 min_c = (U32)((F32)(total) * tail);
-    U32 max_c = (U32)((F32)(total) * (1.0 - tail));
+    U32 max_c = (U32)((F32)(total) * (1.0f - tail));
     
     // Find min and max values
     S32 min_v = 0;
@@ -806,23 +806,23 @@ void LLImageFilter::filterLinearize(F32 tail, const LLColor3& alpha)
         {
             U8 value_i = (i < min_v ? 0 : 255);
             // Blend in with alpha values
-            linear_red_lut[i]   = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
-            linear_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
-            linear_blue_lut[i]  = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
+            linear_red_lut[i]   = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
+            linear_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
+            linear_blue_lut[i]  = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
         }
     }
     else
     {
         // Linearize between min and max
-        F32 slope = 255.0 / (F32)(max_v - min_v);
+        F32 slope = 255.0f / (F32)(max_v - min_v);
         F32 translate = -min_v * slope;
         for (S32 i = 0; i < 256; i++)
         {
             U8 value_i = (U8)(llclampb((S32)(slope*i + translate)));
             // Blend in with alpha values
-            linear_red_lut[i]   = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
-            linear_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
-            linear_blue_lut[i]  = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
+            linear_red_lut[i]   = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
+            linear_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
+            linear_blue_lut[i]  = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
         }
     }
     
@@ -861,9 +861,9 @@ void LLImageFilter::filterEqualize(S32 nb_classes, const LLColor3& alpha)
     for (S32 i = 0; i < 256; i++)
     {
         // Blend in current_value with alpha values
-        equalize_red_lut[i]   = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * current_value);
-        equalize_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * current_value);
-        equalize_blue_lut[i]  = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * current_value);
+        equalize_red_lut[i]   = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * current_value);
+        equalize_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * current_value);
+        equalize_blue_lut[i]  = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * current_value);
         if (cumulated_histo[i] >= (U32)current_count)
         {
             current_count += delta_count;
@@ -882,15 +882,15 @@ void LLImageFilter::filterColorize(const LLColor3& color, const LLColor3& alpha)
     U8 green_lut[256];
     U8 blue_lut[256];
     
-    F32 red_composite   =  255.0 * alpha.mV[0] * color.mV[0];
-    F32 green_composite =  255.0 * alpha.mV[1] * color.mV[1];
-    F32 blue_composite  =  255.0 * alpha.mV[2] * color.mV[2];
+    F32 red_composite   =  255.0f * alpha.mV[0] * color.mV[0];
+    F32 green_composite =  255.0f * alpha.mV[1] * color.mV[1];
+    F32 blue_composite  =  255.0f * alpha.mV[2] * color.mV[2];
     
     for (S32 i = 0; i < 256; i++)
     {
-        red_lut[i]   = (U8)(llclampb((S32)((1.0 - alpha.mV[0]) * (F32)(i) + red_composite)));
-        green_lut[i] = (U8)(llclampb((S32)((1.0 - alpha.mV[1]) * (F32)(i) + green_composite)));
-        blue_lut[i]  = (U8)(llclampb((S32)((1.0 - alpha.mV[2]) * (F32)(i) + blue_composite)));
+        red_lut[i]   = (U8)(llclampb((S32)((1.0f - alpha.mV[0]) * (F32)(i) + red_composite)));
+        green_lut[i] = (U8)(llclampb((S32)((1.0f - alpha.mV[1]) * (F32)(i) + green_composite)));
+        blue_lut[i]  = (U8)(llclampb((S32)((1.0f - alpha.mV[2]) * (F32)(i) + blue_composite)));
     }
     
     colorCorrect(red_lut,green_lut,blue_lut);
@@ -902,15 +902,15 @@ void LLImageFilter::filterContrast(F32 slope, const LLColor3& alpha)
     U8 contrast_green_lut[256];
     U8 contrast_blue_lut[256];
     
-    F32 translate = 128.0 * (1.0 - slope);
+    F32 translate = 128.0f * (1.0f - slope);
     
     for (S32 i = 0; i < 256; i++)
     {
         U8 value_i = (U8)(llclampb((S32)(slope*i + translate)));
         // Blend in with alpha values
-        contrast_red_lut[i]   = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
-        contrast_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
-        contrast_blue_lut[i]  = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
+        contrast_red_lut[i]   = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
+        contrast_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
+        contrast_blue_lut[i]  = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
     }
     
     colorCorrect(contrast_red_lut,contrast_green_lut,contrast_blue_lut);
@@ -922,15 +922,15 @@ void LLImageFilter::filterBrightness(F32 add, const LLColor3& alpha)
     U8 brightness_green_lut[256];
     U8 brightness_blue_lut[256];
     
-    S32 add_value = (S32)(add * 255.0);
+    S32 add_value = (S32)(add * 255.0f);
     
     for (S32 i = 0; i < 256; i++)
     {
         U8 value_i = (U8)(llclampb(i + add_value));
         // Blend in with alpha values
-        brightness_red_lut[i]   = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
-        brightness_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
-        brightness_blue_lut[i]  = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
+        brightness_red_lut[i]   = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
+        brightness_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
+        brightness_blue_lut[i]  = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
     }
     
     colorCorrect(brightness_red_lut,brightness_green_lut,brightness_blue_lut);
diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp
index 6bf59fce6f49cea43895862d25f2e7ce0983e6c9..65b0f3f030036ba3fe0a941e6d7b34204c742f1f 100644
--- a/indra/llimage/llpngwrapper.cpp
+++ b/indra/llimage/llpngwrapper.cpp
@@ -60,7 +60,7 @@ LLPngWrapper::LLPngWrapper()
 	  mCompressionType( 0 ),
 	  mFilterMethod( 0 ),
 	  mFinalSize( 0 ),
-	  mGamma(0.f)
+	  mGamma(0.0)
 {
 }
 
diff --git a/indra/llinventory/lllandmark.cpp b/indra/llinventory/lllandmark.cpp
index 194e5ab02f7c7f33ebb0d7b10808e9902b6bb812..e63cee96a66590acd1249f96fcdbd4eee74fa9f2 100644
--- a/indra/llinventory/lllandmark.cpp
+++ b/indra/llinventory/lllandmark.cpp
@@ -71,9 +71,9 @@ bool LLLandmark::getGlobalPos(LLVector3d& pos)
 		}
 		if((g_x > 0.f) && (g_y > 0.f))
 		{
-			pos.mdV[0] = g_x + mRegionPos.mV[0];
-			pos.mdV[1] = g_y + mRegionPos.mV[1];
-			pos.mdV[2] = mRegionPos.mV[2];
+			pos.mdV[0] = static_cast<F64>(g_x + mRegionPos.mV[0]);
+			pos.mdV[1] = static_cast<F64>(g_y + mRegionPos.mV[1]);
+			pos.mdV[2] = static_cast<F64>(mRegionPos.mV[2]);
 			setGlobalPos(pos);
 		}
 	}
diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h
index a471547326111e5436b8986853f0cb6f785109bf..f5aa981da35449b3dad19f9bbfe8f80b64a0a231 100644
--- a/indra/llmath/llmath.h
+++ b/indra/llmath/llmath.h
@@ -56,6 +56,7 @@ constexpr F32	GRAVITY			= -9.8f;
 
 // mathematical constants
 constexpr F32	F_PI		= 3.1415926535897932384626433832795f;
+constexpr F64	D_PI		= 3.1415926535897932384626433832795;
 constexpr F32	F_TWO_PI	= 6.283185307179586476925286766559f;
 constexpr F32	F_PI_BY_TWO	= 1.5707963267948966192313216916398f;
 constexpr F32	F_SQRT_TWO_PI = 2.506628274631000502415765284811f;
@@ -65,8 +66,10 @@ constexpr F32	F_SQRT3		= 1.73205080756888288657986402541f;
 constexpr F32	OO_SQRT2	= 0.7071067811865475244008443621049f;
 constexpr F32	OO_SQRT3	= 0.577350269189625764509f;
 constexpr F32	DEG_TO_RAD	= 0.017453292519943295769236907684886f;
+constexpr F64	DBL_DEG_TO_RAD	= 0.017453292519943295769236907684886;
 constexpr F32	RAD_TO_DEG	= 57.295779513082320876798154814105f;
 constexpr F32	F_APPROXIMATELY_ZERO = 0.00001f;
+constexpr F64	D_APPROXIMATELY_ZERO = 0.00001;
 constexpr F32	F_LN10		= 2.3025850929940456840179914546844f;
 constexpr F32	OO_LN10		= 0.43429448190325182765112891891661f;
 constexpr F32	F_LN2		= 0.69314718056f;
@@ -80,6 +83,7 @@ constexpr F32	GIMBAL_THRESHOLD = 0.000436f; // sets the gimballock threshold 0.0
 
 // BUG: Eliminate in favor of F_APPROXIMATELY_ZERO above?
 constexpr F32 FP_MAG_THRESHOLD = 0.0000001f;
+constexpr F64 DP_MAG_THRESHOLD = 0.0000001;
 
 // TODO: Replace with logic like is_approx_equal
 inline bool is_approx_zero( F32 f ) { return (-F_APPROXIMATELY_ZERO < f) && (f < F_APPROXIMATELY_ZERO); }
diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h
index 46996869841c31b841d939c0f5e8cdac3492516c..b9934ea0ba6cc40d53825a3bb4678a49d866a03e 100644
--- a/indra/llmath/lloctree.h
+++ b/indra/llmath/lloctree.h
@@ -819,7 +819,7 @@ public:
 			return false;
 		}
 		
-		if (data->getBinRadius() > 4096.0)
+		if (data->getBinRadius() > 4096.f)
 		{
 			OCT_ERRS << "!!! ELEMENT EXCEEDS MAXIMUM SIZE IN OCTREE ROOT !!!" << LL_ENDL;
 			return false;
diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp
index 2d67fb2779e2f5d73e9c4ee7bf87b718608c3515..ecd1c1971d2ed8834e8961f76e456a50c38d3c75 100644
--- a/indra/llmath/llquaternion.cpp
+++ b/indra/llmath/llquaternion.cpp
@@ -580,14 +580,18 @@ LLVector3		operator*(const LLVector3 &a, const LLQuaternion &rot)
 
 LLVector3d		operator*(const LLVector3d &a, const LLQuaternion &rot)
 {
-    F64 rw = - rot.mQ[VX] * a.mdV[VX] - rot.mQ[VY] * a.mdV[VY] - rot.mQ[VZ] * a.mdV[VZ];
-    F64 rx =   rot.mQ[VW] * a.mdV[VX] + rot.mQ[VY] * a.mdV[VZ] - rot.mQ[VZ] * a.mdV[VY];
-    F64 ry =   rot.mQ[VW] * a.mdV[VY] + rot.mQ[VZ] * a.mdV[VX] - rot.mQ[VX] * a.mdV[VZ];
-    F64 rz =   rot.mQ[VW] * a.mdV[VZ] + rot.mQ[VX] * a.mdV[VY] - rot.mQ[VY] * a.mdV[VX];
-
-    F64 nx = - rw * rot.mQ[VX] +  rx * rot.mQ[VW] - ry * rot.mQ[VZ] + rz * rot.mQ[VY];
-    F64 ny = - rw * rot.mQ[VY] +  ry * rot.mQ[VW] - rz * rot.mQ[VX] + rx * rot.mQ[VZ];
-    F64 nz = - rw * rot.mQ[VZ] +  rz * rot.mQ[VW] - rx * rot.mQ[VY] + ry * rot.mQ[VX];
+	F64 rotx = static_cast<F64>(rot.mQ[VX]);
+	F64 roty = static_cast<F64>(rot.mQ[VY]);
+	F64 rotz = static_cast<F64>(rot.mQ[VZ]);
+	F64 rotw = static_cast<F64>(rot.mQ[VW]);
+    F64 rw = - rotx * a.mdV[VX] - roty * a.mdV[VY] - rotz * a.mdV[VZ];
+    F64 rx =   rotw * a.mdV[VX] + roty * a.mdV[VZ] - rotz * a.mdV[VY];
+    F64 ry =   rotw * a.mdV[VY] + rotz * a.mdV[VX] - rotx * a.mdV[VZ];
+    F64 rz =   rotw * a.mdV[VZ] + rotx * a.mdV[VY] - roty * a.mdV[VX];
+
+    F64 nx = - rw * rotx +  rx * rotw - ry * rotz + rz * roty;
+    F64 ny = - rw * roty +  ry * rotw - rz * rotx + rx * rotz;
+    F64 nz = - rw * rotz +  rz * rotw - rx * roty + ry * rotx;
 
     return LLVector3d(nx, ny, nz);
 }
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index ee1692b4977c19ff09b416935ac7d7635efc7162..4b0c127197a2d0c1e2e4beafd255d78eff78e38b 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2964,8 +2964,8 @@ void LLVolume::sculptGenerateSpherePlaceholder()
 
 			F32* p = pt.getF32ptr();
 
-			p[0] = (F32)(sin(F_PI * v) * cos(2.0 * F_PI * u) * RADIUS);
-			p[1] = (F32)(sin(F_PI * v) * sin(2.0 * F_PI * u) * RADIUS);
+			p[0] = (F32)(sin(F_PI * v) * cos(2.f * F_PI * u) * RADIUS);
+			p[1] = (F32)(sin(F_PI * v) * sin(2.f * F_PI * u) * RADIUS);
 			p[2] = (F32)(cos(F_PI * v) * RADIUS);
 
 			llassert(pt.isFinite3());
@@ -3075,15 +3075,15 @@ S32 sculpt_sides(F32 detail)
 
 	// detail is usually one of: 1, 1.5, 2.5, 4.0.
 	
-	if (detail <= 1.0)
+	if (detail <= 1.0f)
 	{
 		return SCULPT_REZ_1;
 	}
-	if (detail <= 2.0)
+	if (detail <= 2.0f)
 	{
 		return SCULPT_REZ_2;
 	}
-	if (detail <= 3.0)
+	if (detail <= 3.0f)
 	{
 		return SCULPT_REZ_3;
 	}
@@ -3518,7 +3518,7 @@ bool LLVolumeParams::setSkew(const F32 skew_value)
 	F32 scale_x		= getRatioX();
 	F32 min_skew_mag = 1.0f - 1.0f / (revolutions * scale_x + 1.0f);
 	// Discontinuity; A revolution of 1 allows skews below 0.5.
-	if ( fabs(revolutions - 1.0f) < 0.001)
+	if ( fabs(revolutions - 1.0f) < 0.001f)
 		min_skew_mag = 0.0f;
 
 	// Clip skew.
diff --git a/indra/llmath/llvolumemgr.cpp b/indra/llmath/llvolumemgr.cpp
index eed61c80252d08df5d9c69437144c68c44bae683..797adb8511a2f5669c6a1ee2e0a53265716a6c21 100644
--- a/indra/llmath/llvolumemgr.cpp
+++ b/indra/llmath/llvolumemgr.cpp
@@ -386,7 +386,7 @@ F32 LLVolumeLODGroup::dump()
 	}
 	usage = usage / (F32)NUM_LODS;
 
-	std::string dump_str = llformat("%.3f %d %d %d %d", usage, mAccessCount[0], mAccessCount[1], mAccessCount[2], mAccessCount[3]);
+	std::string dump_str = fmt::format(fmt("{:.3f} {:d} {:d} {:d} {:d}"), usage, mAccessCount[0], mAccessCount[1], mAccessCount[2], mAccessCount[3]);
 
 	LL_INFOS() << dump_str << LL_ENDL;
 	return usage;
diff --git a/indra/llmath/m3math.cpp b/indra/llmath/m3math.cpp
index 507301169ddc7296acd3dba69ab730f62217998e..e55d9c5a7bd3398bbdff5021cb1dd128fc94a269 100644
--- a/indra/llmath/m3math.cpp
+++ b/indra/llmath/m3math.cpp
@@ -94,31 +94,31 @@ void LLMatrix3::getEulerAngles(F32 *roll, F32 *pitch, F32 *yaw) const
 	F64 cx, cy, cz;					// cosine of angle_x, angle_y, angle_z
 	F64 sx,     sz;					// sine of angle_x, angle_y, angle_z
 
-	angle_y = asin(llclamp(mMatrix[2][0], -1.f, 1.f));
+	angle_y = static_cast<F64>(asin(llclamp(mMatrix[2][0], -1.f, 1.f)));
 	cy = cos(angle_y);
 
 	if (fabs(cy) > 0.005)		// non-zero
 	{
 		// no gimbal lock
-		cx = mMatrix[2][2] / cy;
-		sx = - mMatrix[2][1] / cy;
+		cx = static_cast<F64>(mMatrix[2][2]) / cy;
+		sx = -static_cast<F64>(mMatrix[2][1]) / cy;
 
-		angle_x = (F32) atan2(sx, cx);
+		angle_x = atan2(sx, cx);
 
-		cz = mMatrix[0][0] / cy;
-		sz = - mMatrix[1][0] / cy;
+		cz = static_cast<F64>(mMatrix[0][0]) / cy;
+		sz = static_cast<F64>(-mMatrix[1][0]) / cy;
 
-		angle_z = (F32) atan2(sz, cz);
+		angle_z = atan2(sz, cz);
 	}
 	else
 	{
 		// yup, gimbal lock
-		angle_x = 0;
+		angle_x = 0.0;
 
 		// some tricky math thereby avoided, see article
 
-		cz = mMatrix[1][1];
-		sz = mMatrix[0][1];
+		cz = static_cast<F64>(mMatrix[1][1]);
+		sz = static_cast<F64>(mMatrix[0][1]);
 
 		angle_z = atan2(sz, cz);
 	}
@@ -531,17 +531,17 @@ LLVector3d operator*(const LLVector3d &a, const LLMatrix3 &b)
 {
 	// matrix operates "from the right" on row vector
 	return LLVector3d(
-				a.mdV[VX] * b.mMatrix[VX][VX] + 
-				a.mdV[VY] * b.mMatrix[VY][VX] + 
-				a.mdV[VZ] * b.mMatrix[VZ][VX],
+				a.mdV[VX] * static_cast<F64>(b.mMatrix[VX][VX]) +
+				a.mdV[VY] * static_cast<F64>(b.mMatrix[VY][VX]) +
+				a.mdV[VZ] * static_cast<F64>(b.mMatrix[VZ][VX]),
 	
-				a.mdV[VX] * b.mMatrix[VX][VY] + 
-				a.mdV[VY] * b.mMatrix[VY][VY] + 
-				a.mdV[VZ] * b.mMatrix[VZ][VY],
+				a.mdV[VX] * static_cast<F64>(b.mMatrix[VX][VY]) +
+				a.mdV[VY] * static_cast<F64>(b.mMatrix[VY][VY]) +
+				a.mdV[VZ] * static_cast<F64>(b.mMatrix[VZ][VY]),
 	
-				a.mdV[VX] * b.mMatrix[VX][VZ] + 
-				a.mdV[VY] * b.mMatrix[VY][VZ] + 
-				a.mdV[VZ] * b.mMatrix[VZ][VZ] );
+				a.mdV[VX] * static_cast<F64>(b.mMatrix[VX][VZ]) +
+				a.mdV[VY] * static_cast<F64>(b.mMatrix[VY][VZ]) +
+				a.mdV[VZ] * static_cast<F64>(b.mMatrix[VZ][VZ]) );
 }
 
 bool operator==(const LLMatrix3 &a, const LLMatrix3 &b)
diff --git a/indra/llmath/m4math.cpp b/indra/llmath/m4math.cpp
index b92c99466ced3b8140e706f087737338098f3f8b..da7f78901877cb3876197188ec9536e1e3258581 100644
--- a/indra/llmath/m4math.cpp
+++ b/indra/llmath/m4math.cpp
@@ -842,25 +842,25 @@ LLSD LLMatrix4::getValue() const
 {
 	LLSD ret;
 	
-	ret[0] = mMatrix[0][0];
-	ret[1] = mMatrix[0][1];
-	ret[2] = mMatrix[0][2];
-	ret[3] = mMatrix[0][3];
-
-	ret[4] = mMatrix[1][0];
-	ret[5] = mMatrix[1][1];
-	ret[6] = mMatrix[1][2];
-	ret[7] = mMatrix[1][3];
-
-	ret[8] = mMatrix[2][0];
-	ret[9] = mMatrix[2][1];
-	ret[10] = mMatrix[2][2];
-	ret[11] = mMatrix[2][3];
-
-	ret[12] = mMatrix[3][0];
-	ret[13] = mMatrix[3][1];
-	ret[14] = mMatrix[3][2];
-	ret[15] = mMatrix[3][3];
+	ret[0] = static_cast<LLSD::Real>(mMatrix[0][0]);
+	ret[1] = static_cast<LLSD::Real>(mMatrix[0][1]);
+	ret[2] = static_cast<LLSD::Real>(mMatrix[0][2]);
+	ret[3] = static_cast<LLSD::Real>(mMatrix[0][3]);
+
+	ret[4] = static_cast<LLSD::Real>(mMatrix[1][0]);
+	ret[5] = static_cast<LLSD::Real>(mMatrix[1][1]);
+	ret[6] = static_cast<LLSD::Real>(mMatrix[1][2]);
+	ret[7] = static_cast<LLSD::Real>(mMatrix[1][3]);
+
+	ret[8] = static_cast<LLSD::Real>(mMatrix[2][0]);
+	ret[9] = static_cast<LLSD::Real>(mMatrix[2][1]);
+	ret[10] = static_cast<LLSD::Real>(mMatrix[2][2]);
+	ret[11] = static_cast<LLSD::Real>(mMatrix[2][3]);
+
+	ret[12] = static_cast<LLSD::Real>(mMatrix[3][0]);
+	ret[13] = static_cast<LLSD::Real>(mMatrix[3][1]);
+	ret[14] = static_cast<LLSD::Real>(mMatrix[3][2]);
+	ret[15] = static_cast<LLSD::Real>(mMatrix[3][3]);
 
 	return ret;
 }
diff --git a/indra/llmath/raytrace.cpp b/indra/llmath/raytrace.cpp
index f38fe49bcbf48df9f6fc2606f8f2c0f544c138ea..09cf9f392fb3e505435b21143ffda7bad99a74ec 100644
--- a/indra/llmath/raytrace.cpp
+++ b/indra/llmath/raytrace.cpp
@@ -237,7 +237,7 @@ BOOL ray_cylinder(const LLVector3 &ray_point, const LLVector3 &ray_direction,
 			shortest_distance = ray_to_cyl * cyl_axis;
 			F32 dot = ray_direction * cyl_axis;
 
-			if (shortest_distance > 0.0)
+			if (shortest_distance > 0.0f)
 			{
 			   	if (dot > 0.0f)
 				{
@@ -364,7 +364,7 @@ BOOL ray_cylinder(const LLVector3 &ray_point, const LLVector3 &ray_direction,
 			// calculate intersection of ray and bottom plane
 			line_plane(ray_point, ray_direction, cyl_bottom, cyl_axis, temp_vector); // NOTE side-effect: changing temp_vector
 			shortest_distance = (temp_vector - ray_point).magVec();
-			if ( (ray_direction * cyl_axis) < 0.0)
+			if ( (ray_direction * cyl_axis) < 0.0f)
 			{
 				// ray potentially enters the cylinder at bottom
 				if (shortest_distance > out)
diff --git a/indra/llmath/v2math.cpp b/indra/llmath/v2math.cpp
index a0cd6428538b61c197dcf7aa29b4fd57163298b0..e3facdf4a98bb0ffe429cc7571f6d8595907fd52 100644
--- a/indra/llmath/v2math.cpp
+++ b/indra/llmath/v2math.cpp
@@ -113,8 +113,8 @@ LLVector2 lerp(const LLVector2 &a, const LLVector2 &b, F32 u)
 LLSD LLVector2::getValue() const
 {
 	LLSD ret;
-	ret[0] = mV[0];
-	ret[1] = mV[1];
+	ret[0] = static_cast<F64>(mV[0]);
+	ret[1] = static_cast<F64>(mV[1]);
 	return ret;
 }
 
diff --git a/indra/llmath/v3color.cpp b/indra/llmath/v3color.cpp
index d38f48b11e0a522d679d86368dd2eb020b56d582..dcb64f44a840e3fd2300b9c18d68e2d5e1a26af7 100644
--- a/indra/llmath/v3color.cpp
+++ b/indra/llmath/v3color.cpp
@@ -125,7 +125,7 @@ void LLColor3::calcHSL(F32* hue, F32* saturation, F32* luminance) const
 	}
 	else
 	{
-		if ( L < 0.5 )
+		if ( L < 0.5f )
 			S = del_Max / ( var_Max + var_Min );
 		else
 			S = del_Max / ( 2.0f - var_Max - var_Min );
diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h
index 3f6139b54593b6faa4454de2f241d7e8e84954b5..dea828d6a68012d64d6e320823e33e518efc8b39 100644
--- a/indra/llmath/v3color.h
+++ b/indra/llmath/v3color.h
@@ -61,9 +61,9 @@ public:
 	LLSD getValue() const
 	{
 		LLSD ret;
-		ret[0] = mV[0];
-		ret[1] = mV[1];
-		ret[2] = mV[2];
+		ret[0] = static_cast<LLSD::Real>(mV[0]);
+		ret[1] = static_cast<LLSD::Real>(mV[1]);
+		ret[2] = static_cast<LLSD::Real>(mV[2]);
 		return ret;
 	}
 
diff --git a/indra/llmath/v3dmath.cpp b/indra/llmath/v3dmath.cpp
index a718a851a7ff2279f66a0c8848da07bdcb38e7ff..eccd826dfc3d57e028957521574c87524349924b 100644
--- a/indra/llmath/v3dmath.cpp
+++ b/indra/llmath/v3dmath.cpp
@@ -89,9 +89,9 @@ std::ostream& operator<<(std::ostream& s, const LLVector3d &a)
 
 const LLVector3d& LLVector3d::operator=(const LLVector4 &a) 
 {
-	mdV[0] = a.mV[0];
-	mdV[1] = a.mV[1];
-	mdV[2] = a.mV[2];
+	mdV[0] = static_cast<F64>(a.mV[0]);
+	mdV[1] = static_cast<F64>(a.mV[1]);
+	mdV[2] = static_cast<F64>(a.mV[2]);
 	return *this;
 }
 
diff --git a/indra/llmath/v3dmath.h b/indra/llmath/v3dmath.h
index 38142fb21a09df4d42fb5cfa16eb54cd2924da79..12d60c4834a3022ba03c3dfcec18abf8f32e6ca8 100644
--- a/indra/llmath/v3dmath.h
+++ b/indra/llmath/v3dmath.h
@@ -136,26 +136,26 @@ typedef LLVector3d LLGlobalVec;
 
 inline const LLVector3d &LLVector3d::set(const LLVector3 &vec)
 {
-	mdV[0] = vec.mV[0];
-	mdV[1] = vec.mV[1];
-	mdV[2] = vec.mV[2];
+	mdV[0] = static_cast<F64>(vec.mV[0]);
+	mdV[1] = static_cast<F64>(vec.mV[1]);
+	mdV[2] = static_cast<F64>(vec.mV[2]);
 	return *this;
 }
 
 inline const LLVector3d &LLVector3d::setVec(const LLVector3 &vec)
 {
-	mdV[0] = vec.mV[0];
-	mdV[1] = vec.mV[1];
-	mdV[2] = vec.mV[2];
+	mdV[0] = static_cast<F64>(vec.mV[0]);
+	mdV[1] = static_cast<F64>(vec.mV[1]);
+	mdV[2] = static_cast<F64>(vec.mV[2]);
 	return *this;
 }
 
 
 inline LLVector3d::LLVector3d(void)
 {
-	mdV[0] = 0.f;
-	mdV[1] = 0.f;
-	mdV[2] = 0.f;
+	mdV[0] = 0.0;
+	mdV[1] = 0.0;
+	mdV[2] = 0.0;
 }
 
 inline LLVector3d::LLVector3d(const F64 x, const F64 y, const F64 z)
@@ -174,9 +174,9 @@ inline LLVector3d::LLVector3d(const F64 *vec)
 
 inline LLVector3d::LLVector3d(const LLVector3 &vec)
 {
-	mdV[VX] = vec.mV[VX];
-	mdV[VY] = vec.mV[VY];
-	mdV[VZ] = vec.mV[VZ];
+	mdV[VX] = static_cast<F64>(vec.mV[VX]);
+	mdV[VY] = static_cast<F64>(vec.mV[VY]);
+	mdV[VZ] = static_cast<F64>(vec.mV[VZ]);
 }
 
 /*
@@ -201,33 +201,33 @@ inline BOOL LLVector3d::isFinite() const
 
 inline const LLVector3d&	LLVector3d::clear(void)
 {
-	mdV[0] = 0.f;
-	mdV[1] = 0.f;
-	mdV[2]= 0.f;
+	mdV[0] = 0.0;
+	mdV[1] = 0.0;
+	mdV[2] = 0.0;
 	return (*this);
 }
 
 inline const LLVector3d&	LLVector3d::clearVec(void)
 {
-	mdV[0] = 0.f;
-	mdV[1] = 0.f;
-	mdV[2]= 0.f;
+	mdV[0] = 0.0;
+	mdV[1] = 0.0;
+	mdV[2] = 0.0;
 	return (*this);
 }
 
 inline const LLVector3d&	LLVector3d::setZero(void)
 {
-	mdV[0] = 0.f;
-	mdV[1] = 0.f;
-	mdV[2] = 0.f;
+	mdV[0] = 0.0;
+	mdV[1] = 0.0;
+	mdV[2] = 0.0;
 	return (*this);
 }
 
 inline const LLVector3d&	LLVector3d::zeroVec(void)
 {
-	mdV[0] = 0.f;
-	mdV[1] = 0.f;
-	mdV[2] = 0.f;
+	mdV[0] = 0.0;
+	mdV[1] = 0.0;
+	mdV[2] = 0.0;
 	return (*this);
 }
 
@@ -281,21 +281,21 @@ inline const LLVector3d&	LLVector3d::setVec(const F64 *vec)
 
 inline F64 LLVector3d::normVec(void)
 {
-	F64 mag = (F32) sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]);
+	F64 mag = sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]);
 	F64 oomag;
 
-	if (mag > FP_MAG_THRESHOLD)
+	if (mag > DP_MAG_THRESHOLD)
 	{
-		oomag = 1.f/mag;
+		oomag = 1.0/mag;
 		mdV[0] *= oomag;
 		mdV[1] *= oomag;
 		mdV[2] *= oomag;
 	}
 	else
 	{
-		mdV[0] = 0.f;
-		mdV[1] = 0.f;
-		mdV[2] = 0.f;
+		mdV[0] = 0.0;
+		mdV[1] = 0.0;
+		mdV[2] = 0.0;
 		mag = 0;
 	}
 	return (mag);
@@ -303,21 +303,21 @@ inline F64 LLVector3d::normVec(void)
 
 inline F64 LLVector3d::normalize(void)
 {
-	F64 mag = (F32) sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]);
+	F64 mag = sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]);
 	F64 oomag;
 
-	if (mag > FP_MAG_THRESHOLD)
+	if (mag > DP_MAG_THRESHOLD)
 	{
-		oomag = 1.f/mag;
+		oomag = 1.0/mag;
 		mdV[0] *= oomag;
 		mdV[1] *= oomag;
 		mdV[2] *= oomag;
 	}
 	else
 	{
-		mdV[0] = 0.f;
-		mdV[1] = 0.f;
-		mdV[2] = 0.f;
+		mdV[0] = 0.0;
+		mdV[1] = 0.0;
+		mdV[2] = 0.0;
 		mag = 0;
 	}
 	return (mag);
@@ -327,7 +327,7 @@ inline F64 LLVector3d::normalize(void)
 
 inline F64	LLVector3d::magVec(void) const
 {
-	return (F32) sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]);
+	return sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]);
 }
 
 inline F64	LLVector3d::magVecSquared(void) const
@@ -337,7 +337,7 @@ inline F64	LLVector3d::magVecSquared(void) const
 
 inline F64	LLVector3d::length(void) const
 {
-	return (F32) sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]);
+	return sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]);
 }
 
 inline F64	LLVector3d::lengthSquared(void) const
@@ -369,7 +369,7 @@ inline LLVector3d operator%(const LLVector3d& a, const LLVector3d& b)
 
 inline LLVector3d operator/(const LLVector3d& a, const F64 k)
 {
-	F64 t = 1.f / k;
+	F64 t = 1.0 / k;
 	return LLVector3d( a.mdV[0] * t, a.mdV[1] * t, a.mdV[2] * t );
 }
 
@@ -430,7 +430,7 @@ inline const LLVector3d& operator*=(LLVector3d& a, const F64 k)
 
 inline const LLVector3d& operator/=(LLVector3d& a, const F64 k)
 {
-	F64 t = 1.f / k;
+	F64 t = 1.0 / k;
 	a.mdV[0] *= t;
 	a.mdV[1] *= t;
 	a.mdV[2] *= t;
@@ -447,7 +447,7 @@ inline F64	dist_vec(const LLVector3d& a, const LLVector3d& b)
 	F64 x = a.mdV[0] - b.mdV[0];
 	F64 y = a.mdV[1] - b.mdV[1];
 	F64 z = a.mdV[2] - b.mdV[2];
-	return (F32) sqrt( x*x + y*y + z*z );
+	return sqrt( x*x + y*y + z*z );
 }
 
 inline F64	dist_vec_squared(const LLVector3d& a, const LLVector3d& b)
@@ -476,7 +476,7 @@ inline LLVector3d lerp(const LLVector3d& a, const LLVector3d& b, const F64 u)
 
 inline BOOL	LLVector3d::isNull() const
 {
-	if ( F_APPROXIMATELY_ZERO > mdV[VX]*mdV[VX] + mdV[VY]*mdV[VY] + mdV[VZ]*mdV[VZ] )
+	if ( D_APPROXIMATELY_ZERO > mdV[VX]*mdV[VX] + mdV[VY]*mdV[VY] + mdV[VZ]*mdV[VZ] )
 	{
 		return TRUE;
 	}
@@ -491,8 +491,8 @@ inline F64 angle_between(const LLVector3d& a, const LLVector3d& b)
 	an.normalize();
 	bn.normalize();
 	F64 cosine = an * bn;
-	F64 angle = (cosine >= 1.0f) ? 0.0f :
-				(cosine <= -1.0f) ? F_PI :
+	F64 angle = (cosine >= 1.0) ? 0.0 :
+				(cosine <= -1.0) ? D_PI :
 				acos(cosine);
 	return angle;
 }
@@ -504,7 +504,7 @@ inline BOOL are_parallel(const LLVector3d& a, const LLVector3d& b, const F64 eps
 	an.normalize();
 	bn.normalize();
 	F64 dot = an * bn;
-	if ( (1.0f - fabs(dot)) < epsilon)
+	if ( (1.0 - fabs(dot)) < epsilon)
 	{
 		return TRUE;
 	}
diff --git a/indra/llmath/v3math.cpp b/indra/llmath/v3math.cpp
index 61d8ab44e11457ddf8a8b9c34d5f8075e3b770da..90bbc51c40a2ebf5354db3bb3fb6f6723678efc3 100644
--- a/indra/llmath/v3math.cpp
+++ b/indra/llmath/v3math.cpp
@@ -324,9 +324,9 @@ LLVector3::LLVector3(const LLSD& sd)
 LLSD LLVector3::getValue() const
 {
 	LLSD ret;
-	ret[0] = mV[0];
-	ret[1] = mV[1];
-	ret[2] = mV[2];
+	ret[0] = static_cast<LLSD::Real>(mV[0]);
+	ret[1] = static_cast<LLSD::Real>(mV[1]);
+	ret[2] = static_cast<LLSD::Real>(mV[2]);
 	return ret;
 }
 
diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp
index 6ab436b9de32e5f5382617cacd6c93e11f5ce0e1..893eb09a4680a16f5857e0d75a6880b558d3bda6 100644
--- a/indra/llmath/v4color.cpp
+++ b/indra/llmath/v4color.cpp
@@ -353,7 +353,7 @@ void LLColor4::calcHSL(F32* hue, F32* saturation, F32* luminance) const
 	}
 	else
 	{
-		if ( L < 0.5 )
+		if ( L < 0.5f )
 			S = del_Max / ( var_Max + var_Min );
 		else
 			S = del_Max / ( 2.0f - var_Max - var_Min );
diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h
index eee52a3446b640d0cbaeb5f9d5aadb75f2d9a3ab..20d47f37465f9652b549a9915e381744123b21d0 100644
--- a/indra/llmath/v4color.h
+++ b/indra/llmath/v4color.h
@@ -59,10 +59,10 @@ class LLColor4
 		LLSD getValue() const
 		{
 			LLSD ret;
-			ret[0] = mV[0];
-			ret[1] = mV[1];
-			ret[2] = mV[2];
-			ret[3] = mV[3];
+			ret[0] = static_cast<LLSD::Real>(mV[0]);
+			ret[1] = static_cast<LLSD::Real>(mV[1]);
+			ret[2] = static_cast<LLSD::Real>(mV[2]);
+			ret[3] = static_cast<LLSD::Real>(mV[3]);
 			return ret;
 		}
 	
diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h
index de14574c095f3f197c4b7705a2eed4aed62e732c..29eb7278a661208120ac8b206ee3554f22ff5aeb 100644
--- a/indra/llmath/v4math.h
+++ b/indra/llmath/v4math.h
@@ -54,10 +54,10 @@ class LLVector4
 		LLSD getValue() const
 		{
 			LLSD ret;
-			ret[0] = mV[0];
-			ret[1] = mV[1];
-			ret[2] = mV[2];
-			ret[3] = mV[3];
+			ret[0] = static_cast<LLSD::Real>(mV[0]);
+			ret[1] = static_cast<LLSD::Real>(mV[1]);
+			ret[2] = static_cast<LLSD::Real>(mV[2]);
+			ret[3] = static_cast<LLSD::Real>(mV[3]);
 			return ret;
 		}
 
diff --git a/indra/llmessage/llassetstorage.h b/indra/llmessage/llassetstorage.h
index fac99c7cd43bc59489b16e4ed6827486510dc4df..9fa5b10365d8e93c680697c657f85d6ce993f9ef 100644
--- a/indra/llmessage/llassetstorage.h
+++ b/indra/llmessage/llassetstorage.h
@@ -45,7 +45,7 @@ class LLSD;
 
 // anything that takes longer than this to download will abort.
 // HTTP Uploads also timeout if they take longer than this.
-const F32Minutes LL_ASSET_STORAGE_TIMEOUT(5);
+const F64Minutes LL_ASSET_STORAGE_TIMEOUT(5);
 
 
 // Specific error codes
diff --git a/indra/llmessage/llavatarname.h b/indra/llmessage/llavatarname.h
index 41ddd80815a5aa34529e29b8290fc9585d28b19b..032aab7a2a0d957b594ed687d767eaecea05d653 100644
--- a/indra/llmessage/llavatarname.h
+++ b/indra/llmessage/llavatarname.h
@@ -56,7 +56,7 @@ public:
 	static bool useUsernames();
 
 	// A name object is valid if not temporary and not yet expired (default is expiration not checked)
-	bool isValidName(F64 max_unrefreshed = 0.0f) const { return !mIsTemporaryName && (mExpires >= max_unrefreshed); }
+	bool isValidName(F64 max_unrefreshed = 0.0) const { return !mIsTemporaryName && (mExpires >= max_unrefreshed); }
 	
 	// Return true if the name is made up from legacy or temporary data
 	bool isDisplayNameDefault() const { return mIsDisplayNameDefault; }
diff --git a/indra/llmessage/llchainio.cpp b/indra/llmessage/llchainio.cpp
index bcda6746a1941497d8868173dffba7e7b07aa141..e0d6d1e2d31c27da7815d2145bbe6683263e1fe8 100644
--- a/indra/llmessage/llchainio.cpp
+++ b/indra/llmessage/llchainio.cpp
@@ -45,7 +45,7 @@ bool LLDeferredChain::addToPump(
 {
 	if(!pump) return false;
 	LLPumpIO::chain_t sleep_chain;
-	sleep_chain.push_back(LLIOPipe::ptr_t(new LLIOSleep(in_seconds)));
+	sleep_chain.push_back(LLIOPipe::ptr_t(new LLIOSleep(static_cast<F64>(in_seconds))));
 	sleep_chain.push_back(
 		LLIOPipe::ptr_t(new LLIOAddChain(deferred_chain, chain_timeout)));
 
diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp
index efeaa25697257886900d6275c8975c0d32271fcc..800e873bd3b1544d7ab64da59e82364a2a11eee3 100644
--- a/indra/llmessage/llcircuit.cpp
+++ b/indra/llmessage/llcircuit.cpp
@@ -1186,7 +1186,7 @@ void LLCircuitData::getInfo(LLSD& info) const
 {
 	info["Host"] = mHost.getIPandPort();
 	info["Alive"] = mbAlive;
-	info["Age"] = mExistenceTimer.getElapsedTimeF32();
+	info["Age"] = mExistenceTimer.getElapsedTimeF64().value();
 }
 
 void LLCircuitData::dumpResendCountAndReset()
diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp
index 91cf0825de05eec5623a994314d2e47483638676..8f3c0fd2be46df9b639eaadc5ec5f33163f91c79 100644
--- a/indra/llmessage/llpumpio.cpp
+++ b/indra/llmessage/llpumpio.cpp
@@ -1141,7 +1141,7 @@ void LLPumpIO::LLChainInfo::adjustTimeoutSeconds(F32 delta)
 	if(mTimer.getStarted())
 	{
 		F64 expiry = mTimer.expiresAt();
-		expiry += delta;
+		expiry += static_cast<F64>(delta);
 		mTimer.setExpiryAt(expiry);
 	}
 }
diff --git a/indra/llmessage/llregionhandle.h b/indra/llmessage/llregionhandle.h
index 085757dcbc8d5ce9458c50e6a53f9f7b7e25eab0..66167e8e7c80c2aa2618a43d0560b3b0c16e042a 100644
--- a/indra/llmessage/llregionhandle.h
+++ b/indra/llmessage/llregionhandle.h
@@ -105,7 +105,7 @@ inline void from_region_handle(const U64 &region_handle, U32 *x_pos, U32 *y_pos)
 // return the word-frame XY location of sim's SouthWest corner in LLVector3d
 inline LLVector3d from_region_handle(const U64 &region_handle)
 {
-	return LLVector3d(((U32)(region_handle >> 32)), (U32)(region_handle & 0xFFFFFFFF), 0.f);
+	return LLVector3d(((U32)(region_handle >> 32)), (U32)(region_handle & 0xFFFFFFFF), 0.0);
 }
 
 // grid-based region handle encoding. pass in a grid position
diff --git a/indra/llplugin/llpluginmessage.cpp b/indra/llplugin/llpluginmessage.cpp
index b590f72fad8e05efa9a8d60a8fd52837c160019e..9d03dc6042fd5ad0bb6f38fcc36e400a4d420f9b 100644
--- a/indra/llplugin/llpluginmessage.cpp
+++ b/indra/llplugin/llpluginmessage.cpp
@@ -316,7 +316,7 @@ bool LLPluginMessage::getValueBoolean(const std::string &key) const
  */
 F64 LLPluginMessage::getValueReal(const std::string &key) const
 {
-	F64 result = 0.0f;
+	F64 result = 0.0;
 
 	if(mMessage["params"].has(key))
 	{
diff --git a/indra/llplugin/llpluginmessagepipe.cpp b/indra/llplugin/llpluginmessagepipe.cpp
index 5eba649d355479764d7a927580137ce84358b712..33adcdd3e5bd959c2717961ec7089b8b7d236cc7 100644
--- a/indra/llplugin/llpluginmessagepipe.cpp
+++ b/indra/llplugin/llpluginmessagepipe.cpp
@@ -255,10 +255,10 @@ bool LLPluginMessagePipe::pumpInput(F64 timeout)
 #if LL_WINDOWS
 		if(result)
 		{
-			if(timeout != 0.0f)
+			if(timeout != 0.0)
 			{
-				ms_sleep((int)(timeout * 1000.0f));
-				timeout = 0.0f;
+				ms_sleep((int)(timeout * 1000.0));
+				timeout = 0.0;
 			}
 		}
 #endif
@@ -269,7 +269,7 @@ bool LLPluginMessagePipe::pumpInput(F64 timeout)
 			char input_buf[1024];
 			apr_size_t request_size;
 			
-			if(timeout == 0.0f)
+			if(timeout == 0.0)
 			{
 				// If we have no timeout, start out with a full read.
 				request_size = sizeof(input_buf);
@@ -352,7 +352,7 @@ bool LLPluginMessagePipe::pumpInput(F64 timeout)
 					break;
 				}
 
-				if(timeout != 0.0f)
+				if(timeout != 0.0)
 				{
 					// Second and subsequent reads should not use the timeout
 					setSocketTimeout(0);
diff --git a/indra/llplugin/llpluginmessagepipe.h b/indra/llplugin/llpluginmessagepipe.h
index c3498beac04849e37c7ebabd43c9192df1d5ea9f..46764cef2dbf0573d1cb1db8bc6270092ca5d179 100644
--- a/indra/llplugin/llpluginmessagepipe.h
+++ b/indra/llplugin/llpluginmessagepipe.h
@@ -72,9 +72,9 @@ public:
 	bool addMessage(const std::string &message);
 	void clearOwner(void);
 	
-	bool pump(F64 timeout = 0.0f);
+	bool pump(F64 timeout = 0.0);
 	bool pumpOutput();
-	bool pumpInput(F64 timeout = 0.0f);
+	bool pumpInput(F64 timeout = 0.0);
 		
 protected:	
 	void processInput(void);
diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp
index 58dc68ee7850d586822c7593b269c5cc26c38f3d..de63f7570a2ca94fa2d17ecece85e5cdb2492d95 100644
--- a/indra/llplugin/llpluginprocesschild.cpp
+++ b/indra/llplugin/llpluginprocesschild.cpp
@@ -35,7 +35,7 @@
 
 static const F32 GOODBYE_SECONDS = 20.0f;
 static const F32 HEARTBEAT_SECONDS = 1.0f;
-static const F32 PLUGIN_IDLE_SECONDS = 1.0f / 100.0f;  // Each call to idle will give the plugin this much time.
+static const F64 PLUGIN_IDLE_SECONDS = 1.0 / 100.0;  // Each call to idle will give the plugin this much time.
 
 LLPluginProcessChild::LLPluginProcessChild()
 {
@@ -43,7 +43,7 @@ LLPluginProcessChild::LLPluginProcessChild()
 	mInstance = nullptr;
 	mSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP);
 	mSleepTime = PLUGIN_IDLE_SECONDS;	// default: send idle messages at 100Hz
-	mCPUElapsed = 0.0f;
+	mCPUElapsed = 0.0;
 	mBlockingRequest = false;
 	mBlockingResponseReceived = false;
 }
@@ -149,7 +149,7 @@ void LLPluginProcessChild::idle(void)
 				{
 					mHeartbeat.start();
 					mHeartbeat.setTimerExpirySec(HEARTBEAT_SECONDS);
-					mCPUElapsed = 0.0f;
+					mCPUElapsed = 0.0;
 					setState(STATE_PLUGIN_LOADED);
 				}
 				else
@@ -176,7 +176,7 @@ void LLPluginProcessChild::idle(void)
 			{
 				// Provide some time to the plugin
 				LLPluginMessage message("base", "idle");
-				message.setValueReal("time", PLUGIN_IDLE_SECONDS);
+				message.setValueReal("time", (LLSD::Real)PLUGIN_IDLE_SECONDS);
 				sendMessageToPlugin(message);
 
 				mInstance->idle();
@@ -196,7 +196,7 @@ void LLPluginProcessChild::idle(void)
 
 					mHeartbeat.reset();
 					mHeartbeat.setTimerExpirySec(HEARTBEAT_SECONDS);
-					mCPUElapsed = 0.0f;
+					mCPUElapsed = 0.0;
 				}
 			}
 			// receivePluginMessage will transition to STATE_UNLOADING
@@ -253,7 +253,7 @@ void LLPluginProcessChild::sleep(F64 seconds)
 	}
 	else
 	{
-		ms_sleep((int)(seconds * 1000.0f));
+		ms_sleep((int)(seconds * 1000.0));
 	}
 }
 
@@ -262,7 +262,7 @@ void LLPluginProcessChild::pump(void)
 	deliverQueuedMessages();
 	if (mMessagePipe)
 	{
-		mMessagePipe->pump(0.0f);
+		mMessagePipe->pump(0.0);
 	}
 	else
 	{
diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp
index cb680e1d111a09e5880d4c25c6780e2d76b9a4c7..8ac969c4a35bd7466b76c30ea69bfa6ebaaa3bea 100644
--- a/indra/llplugin/llpluginprocessparent.cpp
+++ b/indra/llplugin/llpluginprocessparent.cpp
@@ -63,12 +63,12 @@ protected:
 	{
 		while(!isQuitting() && LLPluginProcessParent::getUseReadThread())
 		{
-			LLPluginProcessParent::poll(0.1f);
+			LLPluginProcessParent::poll(0.1);
 			checkPause();
 		}
 		
 		// Final poll to clean up the pollset, etc.
-		LLPluginProcessParent::poll(0.0f);
+		LLPluginProcessParent::poll(0.0);
 	} 
 
 	// Inherited from LLThread
@@ -252,7 +252,7 @@ void LLPluginProcessParent::init(const std::string &launcher_filename, const std
 	mProcessParams.cwd = plugin_dir;
 	mPluginFile = plugin_filename;
 	mPluginDir = plugin_dir;
-	mCPUUsage = 0.0f;
+	mCPUUsage = 0.0;
 	mDebug = debug;	
 	setState(STATE_INITIALIZED);
 }
@@ -905,7 +905,7 @@ void LLPluginProcessParent::servicePoll()
 	// poll signalled on this object's socket.  Try to process incoming messages.
 	if(mMessagePipe)
 	{
-		result = mMessagePipe->pumpInput(0.0f);
+		result = mMessagePipe->pumpInput(0.0);
 	}
 
 	if(!result)
@@ -1012,7 +1012,7 @@ void LLPluginProcessParent::receiveMessage(const LLPluginMessage &message)
 				}
 				
 				// Send initial sleep time
-				llassert_always(mSleepTime != 0.f);
+				llassert_always(mSleepTime != 0.0);
 				setSleepTime(mSleepTime, true);			
 
 				setState(STATE_RUNNING);
diff --git a/indra/llplugin/slplugin/slplugin.cpp b/indra/llplugin/slplugin/slplugin.cpp
index edbf0f0e61492e1bc37d7815c70340d1f9a6e46d..9a2ad0ae814229a0608cce2dac35593e2008a167 100644
--- a/indra/llplugin/slplugin/slplugin.cpp
+++ b/indra/llplugin/slplugin/slplugin.cpp
@@ -257,7 +257,7 @@ int main(int argc, char **argv)
 		F64 elapsed = timer.getElapsedTimeF64();
 		F64 remaining = plugin->getSleepTime() - elapsed;
 
-		if(remaining <= 0.0f)
+		if(remaining <= 0.0)
 		{
 			// We've already used our full allotment.
 //			LL_INFOS("slplugin") << "elapsed = " << elapsed * 1000.0f << " ms, remaining = " << remaining * 1000.0f << " ms, not sleeping" << LL_ENDL;
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp
index 5b147de32e3b7a6301c111b25d57d842f75eec30..a182bca31d2a5c1d394c3bc8b4884f1aa6c97568 100644
--- a/indra/llprimitive/lldaeloader.cpp
+++ b/indra/llprimitive/lldaeloader.cpp
@@ -1948,7 +1948,7 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da
 		domFloat4 dom_value = rotate->getValue();
 
 		LLMatrix4 rotation;
-		rotation.initRotTrans(dom_value[3] * DEG_TO_RAD, LLVector3(dom_value[0], dom_value[1], dom_value[2]), LLVector3(0, 0, 0));
+		rotation.initRotTrans(dom_value[3] * DBL_DEG_TO_RAD, LLVector3(dom_value[0], dom_value[1], dom_value[2]), LLVector3(0, 0, 0));
 
 		rotation *= mTransform;
 		mTransform = rotation;
@@ -2245,7 +2245,7 @@ LLImportMaterial LLDAELoader::profileToMaterial(domProfile_COMMON* material, DAE
 	if (emission)
 	{
 		LLColor4 emission_color = getDaeColor(emission);
-		if (((emission_color[0] + emission_color[1] + emission_color[2]) / 3.0) > 0.25)
+		if (((emission_color[0] + emission_color[1] + emission_color[2]) / 3.f) > 0.25f)
 		{
 			mat.mFullbright = TRUE;
 		}
diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index ea5e89f8d6174457d6b784b2821d48fd00f9ca45..6c25a534461b0824f0d64377ecded6da9c997f1f 100644
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -233,11 +233,19 @@ public:
 
 	
 	//Are the doubles the same w/in epsilon specified tolerance
-	bool areEqual( double a, double b ) 
+	bool areEqual( F32 a, F32 b )
 	{
-		const float epsilon = 1e-5f;
+		const F32 epsilon = 1e-5f;
 		return (fabs((a - b)) < epsilon) ? true : false ;
 	}
+
+	//Are the doubles the same w/in epsilon specified tolerance
+	bool areEqual(F64 a, F64 b)
+	{
+		const F64 epsilon = 1e-5;
+		return (fabs((a - b)) < epsilon) ? true : false;
+	}
+
 	//Make sure that we return false for any values that are within the tolerance for equivalence
 	bool jointPositionalLookup( const LLVector3& a, const LLVector3& b ) 
 	{
diff --git a/indra/llprimitive/lltreeparams.cpp b/indra/llprimitive/lltreeparams.cpp
index fb5e2d5bf8cd10a08cfe4a3b4ea6a2c93eb6f800..ed3981886a913ccea62a3baf9c344c736e804b8d 100644
--- a/indra/llprimitive/lltreeparams.cpp
+++ b/indra/llprimitive/lltreeparams.cpp
@@ -173,7 +173,7 @@ F32 LLTreeParams::ShapeRatio(EShapeRatio shape, F32 ratio)
 		case (SR_SPHERICAL):
 			return (.2f + .8f * sinf(F_PI*ratio));
 		case (SR_HEMISPHERICAL):
-			return (.2f + .8f * sinf(.5*F_PI*ratio));
+			return (.2f + .8f * sinf(.5f*F_PI*ratio));
 		case (SR_CYLINDRICAL):
 			return (1);
 		case (SR_TAPERED_CYLINDRICAL):
@@ -187,7 +187,7 @@ F32 LLTreeParams::ShapeRatio(EShapeRatio shape, F32 ratio)
 		case (SR_INVERSE_CONICAL):
 			return (1 - .8f * ratio);
 		case (SR_TEND_FLAME):
-			if (ratio <= .7) {
+			if (ratio <= .7f) {
 				return (.5f + .5f*(ratio/.7f));
 			} else {
 				return (.5f + .5f * (1 - ratio)/.3f);
diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp
index e82b05f562ad306b8b267e407083402914c0f303..fd87740befe3cb209f258515191e54709e31b418 100644
--- a/indra/llrender/llcubemap.cpp
+++ b/indra/llrender/llcubemap.cpp
@@ -463,9 +463,9 @@ void LLCubeMap::paintIn(LLVector3 dir[4], const LLColor4U& col)
 		U8 *td = mRawImages[side]->getData();
 		
 		U16 v_minu = (U16) v_min;
-		U16 v_maxu = (U16) (ceil(v_max) + 0.5);
+		U16 v_maxu = (U16) (ceil(v_max) + 0.5f);
 		U16 h_minu = (U16) h_min;
-		U16 h_maxu = (U16) (ceil(h_max) + 0.5);
+		U16 h_maxu = (U16) (ceil(h_max) + 0.5f);
 
 		for (U16 v = v_minu; v < v_maxu; ++v)
 			for (U16 h = h_minu; h < h_maxu; ++h)
@@ -473,7 +473,7 @@ void LLCubeMap::paintIn(LLVector3 dir[4], const LLColor4U& col)
 		//	for (U16 h = 0; h < RESOLUTION; ++h)
 			{
 				const LLVector3 ray = map(side, v, h);
-				if (ray * center > 0.999)
+				if (ray * center > 0.999f)
 				{
 					const U32 offset = (RESOLUTION * v + h) * 4;
 					for (U8 cc = 0; cc < 3; ++cc)
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 67c1085d941c07ef37fa82be184b7e49fc93c8dc..1501b8b5bb8b31204963c8a43924d121c7979db1 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -1794,7 +1794,7 @@ std::string parse_gl_ext_to_str(F32 glversion)
 {
 	std::string ret;
 #if GL_VERSION_3_0
-	if (glversion >= 3.0)
+	if (glversion >= 3.0f)
 	{
 		GLint n = 0;
 		glGetIntegerv(GL_NUM_EXTENSIONS, &n);
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 2dbd553b64eb243454b1ea28fed7816008694bb1..5ee2b7e2b6b743b2cc30f58f4fa77a2d30b45c7f 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -175,7 +175,7 @@ void LLGLSLShader::dumpStats()
         tris_sec /= seconds;
 
         F32 pct_samples = (F32) ((F64)mSamplesDrawn/(F64)sTotalSamplesDrawn)*100.f;
-        F32 samples_sec = (F32) mSamplesDrawn/1000000000.0;
+        F32 samples_sec = (F32) mSamplesDrawn/1000000000.f;
         samples_sec /= seconds;
 
         F32 pct_calls = (F32) mDrawCalls/(F32)sTotalDrawCalls*100.f;
diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp
index cde672b9d6fd2838f6741e6ff49580232ad1b089..d4a89e2c93a3aa715b708cb9d88a6e01f7f30cc0 100644
--- a/indra/llui/llspinctrl.cpp
+++ b/indra/llui/llspinctrl.cpp
@@ -150,11 +150,11 @@ F32 clamp_precision(F32 value, S32 decimal_precision)
 {
 	// pow() isn't perfect
 	
-	F64 clamped_value = value;
+	F64 clamped_value = (F64)value;
 	for (S32 i = 0; i < decimal_precision; i++)
 		clamped_value *= 10.0;
 
-	clamped_value = floor(clamped_value + 0.5f); // cheap round
+	clamped_value = round(clamped_value); // cheap round
 
 	for (S32 i = 0; i < decimal_precision; i++)
 		clamped_value /= 10.0;
diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp
index 6394a1164f1d1b3c6a0bfc8a2b18abb80b581c2b..b040bef1f215404686bb66146cbbdbf6eb9a1e40 100644
--- a/indra/llxml/llxmlnode.cpp
+++ b/indra/llxml/llxmlnode.cpp
@@ -1556,14 +1556,14 @@ const char *LLXMLNode::parseFloat(const char *str, F64 *dest, U32 precision, Enc
 			return str + 7;
 		}
 
-		F64 negative = 1.0f;
+		F64 negative = 1.0;
 		if (str[0] == '+')
 		{
 			++str;
 		}
 		if (str[0] == '-')
 		{
-			negative = -1.0f;
+			negative = -1.0;
 			++str;
 		}
 
@@ -1640,7 +1640,7 @@ const char *LLXMLNode::parseFloat(const char *str, F64 *dest, U32 precision, Enc
 		
 		F64 ret = F64(int_part) + (F64(f_part)/F64(1LL<<61));
 
-		F64 exponent = 1.f;
+		F64 exponent = 1.0;
 		if (str[0] == 'e')
 		{
 			// Scientific notation!
@@ -1680,7 +1680,7 @@ const char *LLXMLNode::parseFloat(const char *str, F64 *dest, U32 precision, Enc
 				U32 short_dest = (U32)bytes_dest;
 				F32 ret_val;
 				memcpy(&ret_val, &short_dest, sizeof(ret_val));
-				*dest = ret_val;
+				*dest = static_cast<F64>(ret_val);
 			}
 			break;
 		case 64:
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp
index 3d8956f313e627e9aeac1b7a1aad35f786a9faca..321092d8a883c4a25354a67386ca2db2a957fda2 100644
--- a/indra/newview/llcontrolavatar.cpp
+++ b/indra/newview/llcontrolavatar.cpp
@@ -221,7 +221,7 @@ void LLControlAvatar::matchVolumeTransform()
 
 void LLControlAvatar::setGlobalScale(F32 scale)
 {
-    if (scale <= 0.0)
+    if (scale <= 0.0f)
     {
         LL_WARNS() << "invalid global scale " << scale << LL_ENDL;
         return;
diff --git a/indra/newview/llenvmanager.h b/indra/newview/llenvmanager.h
index 1de1029d9f7d1f9a6a7532eca24f67ba508ddde9..51dba8d1dd71e4bd09ebf29fd062b6dc05b3da70 100644
--- a/indra/newview/llenvmanager.h
+++ b/indra/newview/llenvmanager.h
@@ -71,7 +71,7 @@ public:
 	}
 
 	inline LLWLParamKey() // NOT really valid, just so std::maps can return a default of some sort
-		: name(""), scope(SCOPE_LOCAL)
+		: name(), scope(SCOPE_LOCAL)
 	{
 	}
 
@@ -137,7 +137,7 @@ public:
 		mWLDayCycle(LLSD::emptyMap()),
 		mWaterParams(LLSD::emptyMap()),
 		mSkyMap(LLSD::emptyMap()),
-		mDayTime(0.f)
+		mDayTime(0.0)
 	{}
 	LLEnvironmentSettings(LLSD dayCycle, LLSD skyMap, LLSD waterParams, F64 dayTime) :
 		mWLDayCycle(std::move(dayCycle)),
diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp
index 8bd8326bf3388e1a801e5fdde2abaa62f2e48962..0750b74647a97b96364d1aea9fa243e0a30a4722 100644
--- a/indra/newview/llflexibleobject.cpp
+++ b/indra/newview/llflexibleobject.cpp
@@ -43,7 +43,7 @@
 #include "llworld.h"
 #include "llvoavatar.h"
 
-static const F32 SEC_PER_FLEXI_FRAME = 1.f / 60.f; // 60 flexi updates per second
+static const F64 SEC_PER_FLEXI_FRAME = 1.f / 60.f; // 60 flexi updates per second
 /*static*/ F32 LLVolumeImplFlexible::sUpdateFactor = 1.0f;
 std::vector<LLVolumeImplFlexible*> LLVolumeImplFlexible::sInstanceList;
 
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp
index 95e0b7b2d85907c64300ade01f0732a17e0801d5..f302875065bb190fa0f67f775636ec546fb4ece5 100644
--- a/indra/newview/llpanelwearing.cpp
+++ b/indra/newview/llpanelwearing.cpp
@@ -278,7 +278,7 @@ void LLPanelWearing::onOpen(const LLSD& /*info*/)
 
 void LLPanelWearing::draw()
 {
-	if (mUpdateTimer.getStarted() && (mUpdateTimer.getElapsedTimeF32() > 0.1))
+	if (mUpdateTimer.getStarted() && (mUpdateTimer.getElapsedTimeF32() > 0.1f))
 	{
 		mUpdateTimer.stop();
 		updateAttachmentsList();
diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp
index bbc7df2d8b6272a0a812c011c6e25c395f9af089..7f834675c6ec4594eb266fee8556f4fdd0c2da04 100644
--- a/indra/newview/llphysicsmotion.cpp
+++ b/indra/newview/llphysicsmotion.cpp
@@ -44,11 +44,18 @@
 
 inline F64 llsgn(const F64 a)
 {
-        if (a >= 0)
+        if (a >= D_APPROXIMATELY_ZERO)
                 return 1;
         return -1;
 }
 
+inline F32 llsgn(const F32 a)
+{
+	if (a >= F_APPROXIMATELY_ZERO)
+		return 1.f;
+	return -1.f;
+}
+
 LLPhysicsMotion::default_controller_map_t initDefaultController()
 {
         LLPhysicsMotion::default_controller_map_t controller;
@@ -306,8 +313,8 @@ F32 LLPhysicsMotion::calculateAcceleration_local(const F32 velocity_local, const
         const F32 acceleration_local = (velocity_local - mVelocityJoint_local) / time_delta;
         
         const F32 smoothed_acceleration_local = 
-                acceleration_local * 1.0/smoothing + 
-                mAccelerationJoint_local * (smoothing-1.0)/smoothing;
+                acceleration_local * 1.0f/smoothing + 
+                mAccelerationJoint_local * (smoothing-1.0f)/smoothing;
         
         return smoothed_acceleration_local;
 }
@@ -354,7 +361,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
         const F32 time_delta = time - mLastTime;
 	
 	// If less than 1FPS, we don't want to be spending time updating physics at all.
-        if (time_delta > 1.0)
+        if (time_delta > 1.0f)
         {
                 mLastTime = time;
                 return FALSE;
@@ -363,7 +370,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
         // Higher LOD is better.  This controls the granularity
         // and frequency of updates for the motions.
         const F32 lod_factor = LLVOAvatar::sPhysicsLODFactor;
-        if (lod_factor == 0)
+        if (lod_factor == 0.f)
         {
                 return TRUE;
         }
@@ -398,7 +405,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
 	// Calculate velocity and acceleration in parameter space.
 	//
         
-    const F32 joint_local_factor = 30.0;
+    const F32 joint_local_factor = 30.0f;
     const F32 velocity_joint_local = calculateVelocity_local(time_delta * joint_local_factor);
     const F32 acceleration_joint_local = calculateAcceleration_local(velocity_joint_local, time_delta * joint_local_factor);
 	
@@ -432,7 +439,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
 							   1.0f);
 		// If the effect is turned off then don't process unless we need one more update
 		// to set the position to the default (i.e. user) position.
-		if ((behavior_maxeffect == 0) && (position_current_local == position_user_local))
+		if ((behavior_maxeffect == 0.f) && (position_current_local == position_user_local))
 		{
 			return update_visuals;
 		}
@@ -452,7 +459,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
 
 		// Gravity always points downward in world space.
 		// F = mg
-		const LLVector3 gravity_world(0,0,1);
+		const LLVector3 gravity_world(0.f, 0.f, 1.f);
 		const F32 force_gravity = (toLocal(gravity_world) * behavior_gravity * behavior_mass);
                 
 		// Damping is a restoring force that opposes the current velocity.
@@ -461,7 +468,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
                 
 		// Drag is a force imparted by velocity (intuitively it is similar to wind resistance)
 		// F = .5kv^2
-		const F32 force_drag = .5*behavior_drag*velocity_joint_local*velocity_joint_local*llsgn(velocity_joint_local);
+		const F32 force_drag = 0.5f*behavior_drag*velocity_joint_local*velocity_joint_local*llsgn(velocity_joint_local);
 
 		const F32 force_net = (force_accel + 
 				       force_gravity +
@@ -489,18 +496,18 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
 		// Temporary debugging setting to cause all avatars to move, for profiling purposes.
 		if (physics_test)
 		{
-			velocity_new_local = sin(time*4.0);
+			velocity_new_local = sin(time*4.0f);
 		}
 		// Calculate the new parameters, or remain unchanged if max speed is 0.
 		F32 position_new_local = position_current_local + velocity_new_local*time_iteration_step;
-		if (behavior_maxeffect == 0)
+		if (behavior_maxeffect == 0.f)
 			position_new_local = position_user_local;
 
 		// Zero out the velocity if the param is being pushed beyond its limits.
-		if ((position_new_local < 0 && velocity_new_local < 0) || 
-		    (position_new_local > 1 && velocity_new_local > 0))
+		if ((position_new_local < 0.f && velocity_new_local < 0.f) ||
+		    (position_new_local > 1.f && velocity_new_local > 0.f))
 		{
-			velocity_new_local = 0;
+			velocity_new_local = 0.f;
 		}
 	
 		// Check for NaN values.  A NaN value is detected if the variables doesn't equal itself.  
@@ -509,12 +516,12 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
 		    (mVelocity_local != mVelocity_local) ||
 		    (position_new_local != position_new_local))
 		{
-			position_new_local = 0;
-			mVelocity_local = 0;
-			mVelocityJoint_local = 0;
-			mAccelerationJoint_local = 0;
-			mPosition_local = 0;
-			mPosition_world = LLVector3(0,0,0);
+			position_new_local = 0.f;
+			mVelocity_local = 0.f;
+			mVelocityJoint_local = 0.f;
+			mAccelerationJoint_local = 0.f;
+			mPosition_local = 0.f;
+			mPosition_world.setZero();
 		}
 
 		const F32 position_new_local_clamped = llclamp(position_new_local,
@@ -530,7 +537,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
 			if ((driver_param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) &&
 			    (driver_param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT))
 			{
-				mCharacter->setVisualParamWeight(driver_param, 0, FALSE);
+				mCharacter->setVisualParamWeight(driver_param, 0.f, FALSE);
 			}
 			S32 num_driven = driver_param->getDrivenParamsCount();
 			for (S32 i = 0; i < num_driven; ++i)
@@ -553,9 +560,9 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
 		// the graphics LOD settings.
         
 		// For non-self, if the avatar is small enough visually, then don't update.
-		const F32 area_for_max_settings = 0.0;
-		const F32 area_for_min_settings = 1400.0;
-		const F32 area_for_this_setting = area_for_max_settings + (area_for_min_settings-area_for_max_settings)*(1.0-lod_factor);
+		const F32 area_for_max_settings = 0.0f;
+		const F32 area_for_min_settings = 1400.0f;
+		const F32 area_for_this_setting = area_for_max_settings + (area_for_min_settings-area_for_max_settings)*(1.0f-lod_factor);
 	        const F32 pixel_area = sqrtf(mCharacter->getPixelArea());
         
 		const BOOL is_self = (dynamic_cast<LLVOAvatarSelf *>(mCharacter) != nullptr);
@@ -656,8 +663,8 @@ void LLPhysicsMotion::setParamValue(const LLViewerVisualParam *param,
 {
         const F32 value_min_local = param->getMinWeight();
         const F32 value_max_local = param->getMaxWeight();
-        const F32 min_val = 0.5f-behavior_maxeffect/2.0;
-        const F32 max_val = 0.5f+behavior_maxeffect/2.0;
+        const F32 min_val = 0.5f-behavior_maxeffect/2.0f;
+        const F32 max_val = 0.5f+behavior_maxeffect/2.0f;
 
 	// Scale from [0,1] to [min_val,max_val]
 	const F32 new_value_rescaled = min_val + (max_val-min_val) * new_value_normalized;
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index 09f7ba3255c8ac1ca5b9e2b817eabb917cffde4a..ca4c831bc757695a21d43f905bf037032461044c 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -857,9 +857,9 @@ protected:
 	mutable LLVector3		mPositionRegion;
 	mutable LLVector3		mPositionAgent;
 
-	static void setPhaseOutUpdateInterpolationTime(F32 value)	{ sPhaseOutUpdateInterpolationTime = (F64Seconds) value;	}
-	static void setMaxUpdateInterpolationTime(F32 value)		{ sMaxUpdateInterpolationTime = (F64Seconds) value;	}
-	static void setMaxRegionCrossingInterpolationTime(F32 value)		{ sMaxRegionCrossingInterpolationTime = (F64Seconds) value; }
+	static void setPhaseOutUpdateInterpolationTime(F32 value)	{ sPhaseOutUpdateInterpolationTime = F64Seconds((F64)value);	}
+	static void setMaxUpdateInterpolationTime(F32 value)		{ sMaxUpdateInterpolationTime = F64Seconds((F64)value);	}
+	static void setMaxRegionCrossingInterpolationTime(F32 value)		{ sMaxRegionCrossingInterpolationTime = F64Seconds((F64)value); }
 
 	static void	setVelocityInterpolate(BOOL value)		{ sVelocityInterpolate = value;	}
 	static void	setPingInterpolate(BOOL value)			{ sPingInterpolate = value;	}
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 90b78d2af4504800ac53b457dc8c9b3d957ce3b2..90672b252643a6a1f4458c28613b3af6489186c2 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -859,8 +859,8 @@ void LLViewerObjectList::update(LLAgent &agent)
 	F32 interp_time = cc_interpolation_time;
 	F32 phase_out_time = cc_interpolation_phase_out;
 	F32 region_interp_time = llclamp(cc_ping_region_cross_interp(), 0.5f, 5.f);
-	if (interp_time < 0.0 || 
-		phase_out_time < 0.0 ||
+	if (interp_time < 0.0f || 
+		phase_out_time < 0.0f ||
 		phase_out_time > interp_time)
 	{
 		LL_WARNS() << "Invalid values for InterpolationTime or InterpolationPhaseOut, resetting to defaults" << LL_ENDL;
diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp
index e16058bdbd49a2ae838c55b3e2c5b3f290b3a3c7..cf77f034a9938e7dc1ab97b578bc5f5ab9b48e68 100644
--- a/indra/newview/llviewerpartsource.cpp
+++ b/indra/newview/llviewerpartsource.cpp
@@ -378,7 +378,7 @@ void LLViewerPartSourceScript::update(const F32 dt)
 				part->mPosAgent = mPosAgent;
 				
 				// original implemenetation for part_dir_vector was just:					
-				LLVector3 part_dir_vector(0.0, 0.0, 1.0);
+				LLVector3 part_dir_vector(0.0f, 0.0f, 1.0f);
 				// params from the script...
 				// outer = outer cone angle
 				// inner = inner cone angle
@@ -389,24 +389,24 @@ void LLViewerPartSourceScript::update(const F32 dt)
 				// generate a random angle within the given space...
 				F32 angle = innerAngle + ll_frand(outerAngle - innerAngle);
 				// split which side it will go on randomly...
-				if (ll_frand() < 0.5) 
+				if (ll_frand() < 0.5f) 
 				{
 					angle = -angle;
 				}
 				// Both patterns rotate around the x-axis first:
-				part_dir_vector.rotVec(angle, 1.0, 0.0, 0.0);
+				part_dir_vector.rotVec(angle, 1.0f, 0.0f, 0.0f);
 
 				// If this is a cone pattern, rotate again to create the cone.
 				if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_ANGLE_CONE)
 				{
-					part_dir_vector.rotVec(ll_frand(4*F_PI), 0.0, 0.0, 1.0);
+					part_dir_vector.rotVec(ll_frand(4.f*F_PI), 0.0f, 0.0f, 1.0f);
 				}
 								
 				// Only apply this rotation if using the deprecated angles. 
 				if (! (mPartSysData.mFlags & LLPartSysData::LL_PART_USE_NEW_ANGLE))
 				{
 					// Deprecated...
-					part_dir_vector.rotVec(outerAngle, 1.0, 0.0, 0.0);
+					part_dir_vector.rotVec(outerAngle, 1.0f, 0.0f, 0.0f);
 				}
 				
 				if (mSourceObjectp)
@@ -433,7 +433,7 @@ void LLViewerPartSourceScript::update(const F32 dt)
 			if (part->mFlags & LLPartData::LL_PART_FOLLOW_SRC_MASK ||	// SVC-193, VWR-717
 				part->mFlags & LLPartData::LL_PART_TARGET_LINEAR_MASK) 
 			{
-				mPartSysData.mBurstRadius = 0; 
+				mPartSysData.mBurstRadius = 0.f; 
 			}
 
 			LLViewerPartSim::getInstance()->addPart(part);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 93045582adb6536eecab79699d577b8cfcd1a94e..2b68056909c4237e966fbd08abb85291c88e7649 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -5631,7 +5631,7 @@ void LLPickInfo::fetchResults()
 			}
 
 			// Fudge the land focus a little bit above ground.
-			mPosGlobal = land_pos + LLVector3d::z_axis * 0.1f;
+			mPosGlobal = land_pos + LLVector3d::z_axis * 0.1;
 		}
 		else
 		{
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index e90321f5a6b164af2d548f94363964cce53932b5..9a16f8d5e94fbd13a04b627123da1b1fe8637578 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1350,10 +1350,10 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
     // case. For most models, starting with the pelvis is safe though.
     LLVector3 zero_pos;
 	LLVector4a pos;
-    if (dist_vec(zero_pos, mPelvisp->getWorldPosition())<0.001)
+    if (dist_vec(zero_pos, mPelvisp->getWorldPosition()) < 0.001f)
     {
         // Don't use pelvis until av initialized
-	pos.load3(getRenderPosition().mV);
+		pos.load3(getRenderPosition().mV);
     }
     else
     {
@@ -3613,10 +3613,10 @@ void LLVOAvatar::updateAppearanceMessageDebugText()
 		bool hover_enabled = getRegion() && getRegion()->avatarHoverHeightEnabled();
 		debug_line += hover_enabled ? " H" : " h";
 		const LLVector3& hover_offset = getHoverOffset();
-		if (hover_offset[2] != 0.0)
+		if (hover_offset[VZ] != 0.f)
 		{
-			debug_line += llformat(" hov_z: %.3f", hover_offset[2]);
-        debug_line += llformat(" %s", (isSitting() ? "S" : "T"));
+			debug_line += llformat(" hov_z: %.3f", hover_offset[VZ]);
+			debug_line += llformat(" %s", (isSitting() ? "S" : "T"));
 			debug_line += llformat("%s", (isMotionActive(ANIM_AGENT_SIT_GROUND_CONSTRAINED) ? "G" : "-"));
 		}
 
@@ -4381,8 +4381,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
 	if (!getParent() && (isSitting() || was_sit_ground_constrained))
 	{
 		
-		F32 off_z = LLVector3d(getHoverOffset()).mdV[VZ];
-		if (off_z != 0.0)
+		F32 off_z = getHoverOffset().mV[VZ];
+		if (off_z != 0.f)
 		{
 			LLVector3 pos = mRoot->getWorldPosition();
 			pos.mV[VZ] += off_z;
@@ -5528,9 +5528,9 @@ void LLVOAvatar::resolveRayCollisionAgent(const LLVector3d start_pt, const LLVec
 
 void LLVOAvatar::resolveHeightGlobal(const LLVector3d &inPos, LLVector3d &outPos, LLVector3 &outNorm)
 {
-	LLVector3d zVec(0.0f, 0.0f, 0.5f);
-	LLVector3d p0 = inPos + zVec;
-	LLVector3d p1 = inPos - zVec;
+	static const LLVector3d zVec(0.0, 0.0, 0.5);
+	const LLVector3d p0 = inPos + zVec;
+	const LLVector3d p1 = inPos - zVec;
 	LLViewerObject *obj;
 	LLWorld::getInstance()->resolveStepHeightGlobal(this, p0, p1, outPos, outNorm, &obj);
 	if (!obj)
@@ -6565,9 +6565,7 @@ LLVector3 LLVOAvatar::getCharacterAngularVelocity()
 //-----------------------------------------------------------------------------
 void LLVOAvatar::getGround(const LLVector3 &in_pos_agent, LLVector3 &out_pos_agent, LLVector3 &outNorm)
 {
-	LLVector3d z_vec(0.0f, 0.0f, 1.0f);
-	LLVector3d p0_global, p1_global;
-
+	static const LLVector3d z_vec(0.0, 0.0, 1.0);
 	if (isUIAvatar())
 	{
 		outNorm.setVec(z_vec);
@@ -6575,8 +6573,8 @@ void LLVOAvatar::getGround(const LLVector3 &in_pos_agent, LLVector3 &out_pos_age
 		return;
 	}
 	
-	p0_global = gAgent.getPosGlobalFromAgent(in_pos_agent) + z_vec;
-	p1_global = gAgent.getPosGlobalFromAgent(in_pos_agent) - z_vec;
+	const LLVector3d p0_global = gAgent.getPosGlobalFromAgent(in_pos_agent) + z_vec;
+	const LLVector3d p1_global = gAgent.getPosGlobalFromAgent(in_pos_agent) - z_vec;
 	LLViewerObject *obj;
 	LLVector3d out_pos_global;
 	LLWorld::getInstance()->resolveStepHeightGlobal(this, p0_global, p1_global, out_pos_global, outNorm, &obj);
@@ -10532,7 +10530,7 @@ void LLVOAvatar::calcMutedAVColor()
     {
         // select a color based on the first byte of the agents uuid so any muted agent is always the same color
         F32 color_value = (F32) (av_id.mData[0]);
-        F32 spectrum = (color_value / 256.0);		// spectrum is between 0 and 1.f
+        F32 spectrum = (color_value / 256.f);		// spectrum is between 0 and 1.f
 
         // Array of colors.  These are arranged so only one RGB color changes between each step, 
         // and it loops back to red so there is an even distribution.  It is not a heat map
diff --git a/indra/newview/llvoground.cpp b/indra/newview/llvoground.cpp
index 5bf63b26050a9a8407dda9b24590c4d8449b1f28..612463b29b0174b8fb349ff58bef53994ead1899 100644
--- a/indra/newview/llvoground.cpp
+++ b/indra/newview/llvoground.cpp
@@ -113,7 +113,7 @@ BOOL LLVOGround::updateGeometry(LLDrawable *drawable)
 	//
 	LLVector3 at_dir = LLViewerCamera::getInstance()->getAtAxis();
 	at_dir.mV[VZ] = 0.f;
-	if (at_dir.normVec() < 0.01)
+	if (at_dir.normVec() < 0.01f)
 	{
 		// We really don't care, as we're not looking anywhere near the horizon.
 	}
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 0028bf2e715d021d7d56b7c5535ec4b17b3300dc..05153a057129732281e9399c200f160d67b39d61 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -178,12 +178,12 @@ public:
 			if (interest < (F64)0.0)
 			{
 				// media interest not valid yet, try pixel area
-				interest = mObject->getPixelArea();
+				interest = static_cast<F64>(mObject->getPixelArea());
 				// HACK: force recalculation of pixel area if interest is the "magic default" of 1024.
-				if (interest == 1024.f)
+				if (interest == 1024.0)
 				{
 					const_cast<LLVOVolume*>(static_cast<LLVOVolume*>(mObject))->setPixelAreaAndAngle(gAgent);
-					interest = mObject->getPixelArea();
+					interest = static_cast<F64>(mObject->getPixelArea());
 				}
 			}
 			return interest; 
@@ -3928,7 +3928,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
                 // Scaling here is to make animated object vs
                 // non-animated object ARC proportional to the
                 // corresponding calculations for streaming cost.
-                num_triangles = (ANIMATED_OBJECT_COST_PER_KTRI * 0.001 * costs.getEstTrisForStreamingCost())/0.06;
+                num_triangles = (ANIMATED_OBJECT_COST_PER_KTRI * 0.001f * costs.getEstTrisForStreamingCost()) / 0.06f;
             }
             else
             {
@@ -4121,7 +4121,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
     // triangles, but not weighted by any graphics properties.
     if (isAnimatedObject() && isRootEdit())
     {
-        shame += (ANIMATED_OBJECT_BASE_COST/0.06) * 5.0f;
+        shame += (ANIMATED_OBJECT_BASE_COST/0.06f) * 5.0f;
     }
 
 	if (shame > mRenderComplexity_current)
diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp
index eca649e45fd8f11b785f50af0d85d8e3cb163bc0..4f9caeccb908bd6ec7dd1d1fd285e8bff28461fc 100644
--- a/indra/newview/llwlparamset.cpp
+++ b/indra/newview/llwlparamset.cpp
@@ -382,7 +382,7 @@ void LLWLParamSet::updateCloudScrolling(void)
 {
 	static LLTimer s_cloud_timer;
 
-	F64 delta_t = s_cloud_timer.getElapsedTimeAndResetF64();
+	F64 delta_t = s_cloud_timer.getElapsedTimeAndResetF32();
 
 	if(getEnableCloudScrollX())
 	{
diff --git a/indra/newview/llworldmipmap.cpp b/indra/newview/llworldmipmap.cpp
index f0a36d8836cc7f20fa7f07e9616451d8c31b3c60..f987797328c0cd555b336478d92f6e6cbb43587c 100644
--- a/indra/newview/llworldmipmap.cpp
+++ b/indra/newview/llworldmipmap.cpp
@@ -259,8 +259,8 @@ void LLWorldMipmap::globalToMipmap(F64 global_x, F64 global_y, S32 level, U32* g
 	llassert(level >= 1);
 
 	// Convert world coordinates into grid coordinates
-	*grid_x = lltrunc(global_x/REGION_WIDTH_METERS);
-	*grid_y = lltrunc(global_y/REGION_WIDTH_METERS);
+	*grid_x = lltrunc(global_x/static_cast<F64>(REGION_WIDTH_METERS));
+	*grid_y = lltrunc(global_y/ static_cast<F64>(REGION_WIDTH_METERS));
 	// Compute the valid grid coordinates at that level of the mipmap
 	S32 regions_in_tile = 1 << (level - 1);
 	*grid_x = *grid_x - (*grid_x % regions_in_tile);
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 9441086399f62cfb7a85fd1ba1cf50d0a629f102..7f6fbef7a6cd4aaf342f3af244e46cb9b0a756e9 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -10436,7 +10436,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 	{
 		LLTrace::CountStatHandle<>* velocity_stat = LLViewerCamera::getVelocityStat();
 		F32 fade_amt = gFrameIntervalSeconds.value() 
-			* llmax(LLTrace::get_frame_recording().getLastRecording().getSum(*velocity_stat) / LLTrace::get_frame_recording().getLastRecording().getDuration().value(), 1.0);
+			* (F32)llmax(LLTrace::get_frame_recording().getLastRecording().getSum(*velocity_stat) / LLTrace::get_frame_recording().getLastRecording().getDuration().value(), 1.0);
 
 		//update shadow targets
 		for (U32 i = 0; i < 2; i++)